--- Makefile.orig	2014-05-17 18:32:47 UTC
+++ Makefile
@@ -140,7 +140,7 @@ OPTLEV=-O3
 #POLL_POINTER=-DPOLL_POINTER
 
 # gcc or g++
-CC=gcc
+CC?=gcc
 ifdef CC_WATCOM
   CC=WATCOMC
 endif
@@ -263,9 +263,9 @@ ifeq ($(SMIF), SDL)
   else
     # default is Linux, for all unix SDL
     EXENAME:=doomlegacy
-    OPTS:=-DLINUX
+    OPTS:=-DLINUX -DFREEBSD
     LDFLAGS=-L/usr/X11R6/lib
-    LIBS:=-lGL -lGLU -lm
+    LIBS:=-lGL -lGLU -lm -lipx
     # -L/usr/X11R6/lib is needed by Linux 2.4 and others that still have
     # the GLU libraries in an X11 directory.
     # -lm is needed for pow, powf, and other MATH1 functions.
@@ -599,7 +599,7 @@ ifdef CDMUS
 endif
 
 # compiler and linker flags
-CFLAGS:=$(WFLAGS)
+#CFLAGS:=$(WFLAGS)
 
 ifdef PROFILEMODE
 # build with gprof profiling information
@@ -616,7 +616,7 @@ ifdef DEBUG
 else
 # build a normal optimized version
   #CFLAGS+=-O3
-  CFLAGS+=$(OPTLEV) -fomit-frame-pointer
+  #CFLAGS+=$(OPTLEV) -fomit-frame-pointer
 endif
 endif
 
@@ -1002,7 +1002,7 @@ endif
 ../dep/main_t.dep : t*.c
 # none: e*.c j*.c k*.c l*.c n*.c o*.c
 ../dep/hard1.dep : hardware/*.c
-../dep/hard2.dep : hardware/*/*.c
+../dep/hard2.dep : hardware/r_opengl/*.c
 # $(INTERFACE).dep : $(INTERFACE)/*.c
 ../dep/djgppdos.dep : djgppdos/*.c
 ../dep/linux_x.dep : linux_x/*.c linux_x/musserv/*.c linux_x/sndserv/*.c
