Ignore:
Timestamp:
Nov 3, 2014, 4:38:08 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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
Message:

add compiler flag to driver, update examples, fix unnamed bit fields

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/examples/Makefile

    r93885663 r134b86a  
    1 CC=cfa
    2 CFLAGS=-g
     1CC=../../bin/cfa
     2CFLAGS = -g -Wunused-function -MD
     3MAKEFILE_NAME = ${firstword ${MAKEFILE_LIST}}   # makefile name
    34
    4 %.i: %.c
    5         -$(CC) $(CFLAGS) -CFA $< > $@
     5OBJECTS1 = iostream.o fstream.o fstream_test.o
     6EXEC1 = fstream_test
    67
    7 %.o: %.i
    8         $(CC) $(CFLAGS) -c -o $@ $<
     8OBJECTS2 = vector_int.o fstream.o iostream.o array.o iterator.o vector_test.o
     9EXEC2 = vector_test
    910
    10 all: vector_test
     11OBJECTS = ${OBJECTS1} ${OBJECTS2}               # all object files
     12DEPENDS = ${OBJECTS:.o=.d}                      # substitute ".o" with ".d"
     13EXECS = ${EXEC1} ${EXEC2}                       # all executables
    1114
    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 ##########
    1416
    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
    2218
    23 clean:
    24         rm -f fstream_test vector_test *.i *.o
     19all : ${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
     31clean :                                         # remove files that can be regenerated
     32        rm -f ${DEPENDS} ${OBJECTS} ${EXECS} *.class
Note: See TracChangeset for help on using the changeset viewer.