GC = ../gc6.4 CFLAGS = -g -Wall -Werror -I$(GC)/include $(OPTFLAGS) LIBCFLAGS = -O3 LDLIBS = $(GC)/gc.a CCACHE = # ccache CC = $(CCACHE) cc all : $(GC)/gc.a libidst.o idst idst : idst.o libidst.o $(CC) $(CFLAGS) -o idst idst.o libidst.o $(LDLIBS) idst.o : idst.c idst.h $(CC) $(CFLAGS) -c idst.c libidst.o : libidst.c idst.h $(CC) $(CFLAGS) $(LIBCFLAGS) -c libidst.c new : idst libidst.o .force time ./idst -I.. -I../Smalltalk -o idst-new.c idst.st $(CC) $(CFLAGS) -o idst-new idst-new.c libidst.o $(LDLIBS) time ./idst-new -I.. -I../Smalltalk -o idst-newer.c idst.st -cmp idst-new.c idst-newer.c $(CC) $(CFLAGS) -o idst-newer idst-newer.c libidst.o $(LDLIBS) time ./idst-newer -I.. -I../Smalltalk -o idst-newest.c idst.st -cmp idst-newer.c idst-newest.c # rm idst-newer idst-newest idst-newer.c idst-newest.c bootstrap : libidst.o ../xidst/xidst .force time ../xidst/xidst -I.. -I../Smalltalk -o stage1.c idst.st $(CC) $(CFLAGS) -o stage1 stage1.c libidst.o $(LDLIBS) time ./stage1 -I.. -I../Smalltalk -o stage2.c idst.st cmp stage1.c stage2.c $(CC) $(CFLAGS) -o stage2 stage2.c libidst.o $(LDLIBS) time ./stage2 -I.. -I../Smalltalk -o idst.c idst.st cmp idst.c stage2.c $(MAKE) test @echo @echo "Congratulations -- you have a working idst compiler" @echo ../xidst/xidst : $(SHELL) -ec 'cd ../xidst; $(MAKE)' libidst.o : libidst.c idst.h $(GC)/gc.a : $(SHELL) -ec 'cd $(GC); $(MAKE) c++ >/dev/null' test : idst time ./idst -I.. -I../Smalltalk -o test.c test.st gcc $(CFLAGS) -o test test.c libidst.o $(LDLIBS) -@echo '----------------------------------------------------------------' ./test idst-old : main libidst.o *.st */*.st idst.h ./main -ISmalltalk -o idst.c idst.st gcc $(CFLAGS) -o idst idst.c libidst.o $(LDLIBS) clean: .force -rm -f idst idst-new* stage* idst.o libidst.o test test.c *~ .gdb* spotless : clean -rm -f idst.c stats : .force @wc -l $(CCOBJS:.o=.cc) *.{h,l,y} @cat $(CCOBJS:.o=.cc) *.{h,l,y} | sort -u | wc -l .force : #-include $(DEPS) %.d : %.cc $(SHELL) -ec '$(CXX) -MM $(CXXFLAGS) $< \ | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ [ -s $@ ] || rm -f $@' %.d : %.c $(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \ | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ [ -s $@ ] || rm -f $@'