Changeset 134b86a for translator/examples/Makefile
- Timestamp:
- Nov 3, 2014, 4:38:08 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 8c17ab0
- Parents:
- 93885663
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/examples/Makefile
r93885663 r134b86a 1 CC=cfa 2 CFLAGS=-g 1 CC=../../bin/cfa 2 CFLAGS = -g -Wunused-function -MD 3 MAKEFILE_NAME = ${firstword ${MAKEFILE_LIST}} # makefile name 3 4 4 %.i: %.c 5 -$(CC) $(CFLAGS) -CFA $< > $@ 5 OBJECTS1 = iostream.o fstream.o fstream_test.o 6 EXEC1 = fstream_test 6 7 7 %.o: %.i 8 $(CC) $(CFLAGS) -c -o $@ $< 8 OBJECTS2 = vector_int.o fstream.o iostream.o array.o iterator.o vector_test.o 9 EXEC2 = vector_test 9 10 10 all: vector_test 11 OBJECTS = ${OBJECTS1} ${OBJECTS2} # all object files 12 DEPENDS = ${OBJECTS:.o=.d} # substitute ".o" with ".d" 13 EXECS = ${EXEC1} ${EXEC2} # all executables 11 14 12 vector_test: vector_test.o vector_int.o fstream.o iostream.o array.o iterator.o 13 fstream_test: fstream_test.o fstream.o iostream.o 15 ########## Targets ########## 14 16 15 array.o: array.i array.h iterator.h 16 iterator.o: iterator.i iterator.h iostream.h 17 vector_test.o: vector_test.i vector_int.h iostream.h fstream.h 18 vector_int.o: vector_int.i vector_int.h 19 fstream_test.o: fstream_test.i iostream.h fstream.h 20 fstream.o: fstream.i iostream.h fstream.h 21 iostream.o: iostream.i iostream.h 17 .PHONY : all clean # not file names 22 18 23 clean: 24 rm -f fstream_test vector_test *.i *.o 19 all : ${EXECS} # build all executables 20 21 ${EXEC1} : ${OBJECTS1} # link step 1st executable 22 ${CC} ${CCFLAGS} $^ -o $@ # additional object files before $^ 23 24 ${EXEC2} : ${OBJECTS2} # link step 2nd executable 25 ${CC} ${CCFLAGS} $^ -o $@ # additional object files before $^ 26 27 ${OBJECTS} : ${MAKEFILE_NAME} # OPTIONAL : changes to this file => recompile 28 29 -include ${DEPENDS} # include *.d files containing program dependences 30 31 clean : # remove files that can be regenerated 32 rm -f ${DEPENDS} ${OBJECTS} ${EXECS} *.class
Note: See TracChangeset
for help on using the changeset viewer.