$FreeBSD$ --- src/Makefile.orig 2011-07-28 04:59:26.000000000 -0700 +++ src/Makefile 2011-07-30 00:27:22.000000000 -0700 @@ -16,17 +16,17 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # -HOST= DARWIN -DEFINES=-D$(HOST) # -DNETWORK_EXTENSIONS -DCLOSURES -DCO_THROTTLE=50 -DDUMP_FUNCS +HOST= FREEBSD +DEFINES=-D$(HOST) $(EXTRA_DEFINES) # -DNETWORK_EXTENSIONS -DCLOSURES -DCO_THROTTLE=50 -DDUMP_FUNCS DEBUG= -O -g -CCFLAGS=$(DEFINES) $(DEBUG) +CCFLAGS=$(DEFINES) CFLAGS= -I. -Icomp -Ilex -Ied -Iparser -Ikfun $(CCFLAGS) LDFLAGS= -LIBS= -ldl # FreeBSD may require "make HOST=FREEBSD LIBS=" +LIBS= LINTFLAGS=-abcehpruz -CC= gcc +CC?= gcc LD= $(CC) -DMAKE= make +DMAKE= $(MAKE) YACC= yacc BIN= ../bin @@ -37,6 +37,8 @@ COMPOBJ=alloc.o error.o hash.o path.o str.o array.o object.o sdata.o data.o \ interpret.o config.o ext.o +all: a.out comp/a.out + a.out: $(OBJ) always cd comp; $(DMAKE) 'CC=$(CC)' 'CCFLAGS=$(CCFLAGS)' 'YACC=$(YACC)' dgd cd lex; $(DMAKE) 'CC=$(CC)' 'CCFLAGS=$(CCFLAGS)' dgd @@ -56,10 +58,15 @@ all: a.out $(BIN)/driver: a.out + -mkdir $(BIN) -mv $(BIN)/driver $(BIN)/driver.old cp a.out $(BIN)/driver -install: $(BIN)/driver +$(BIN)/precomp: comp/a.out + -mv $(BIN)/precomp $(BIN)/precomp.old + cp comp/a.out $(BIN)/precomp + +install: $(BIN)/driver $(BIN)/precomp lint: lint $(LINTFLAGS) $(CFLAGS) $(SRC) @@ -85,7 +92,8 @@ comp/a.out: cd comp; $(DMAKE) 'DMAKE=$(DMAKE)' 'CC=$(CC)' 'CCFLAGS=$(CCFLAGS)' \ - 'YACC=$(YACC)' 'LIBS=$(LIBS)' a.out + 'LDFLAGS=$(LDFLAGS)' 'YACC=$(YACC)' 'LIBS=$(LIBS)' \ + a.out clean: rm -f a.out $(OBJ) comp.sub lex.sub ed.sub