stage1_2/Makefile
changeset 159 1e4eb0d48385
parent 68 b0a43002dcac
child 172 bfa2e7806d7d
equal deleted inserted replaced
158:eb8a5df69bb0 159:1e4eb0d48385
     3 
     3 
     4 
     4 
     5 
     5 
     6 default:	all
     6 default:	all
     7 
     7 
     8 .PHONY: iec.flex
       
     9 
       
    10 all: iec.flex.o iec.y.o stage1_2.o
     8 all: iec.flex.o iec.y.o stage1_2.o
    11 
     9 
    12 
       
    13 
       
    14 clean:
    10 clean:
    15 	-rm -f *.o Makefile.depend
    11 	echo > Makefile.depend
    16 	-rm -f iec.flex.c iec.y.cc iec.y.hh iec.y.output
    12 	-rm -f iec.flex.c iec.y.cc iec.y.hh iec.y.output
    17 	-rm -f iec.noerrorcheck.y
    13 	-rm -f iec.noerrorcheck.y
    18 	-rm -f test_flex
    14 	-rm -f test_flex
    19 
    15 
    20 
       
    21 CFLAGS += -I. -I../* -I../../absyntax
    16 CFLAGS += -I. -I../* -I../../absyntax
    22 
       
    23 
       
    24 
       
    25 test_flex: iec.flex.c iec.y.hh
       
    26 	$(CXX) -o test_flex.o -c iec.flex.c -DTEST_MAIN $(CFLAGS)
       
    27 	$(CXX) -o test_flex test_flex.o
       
    28 #	$(CXX) -o test_flex test_flex.o ../util/symtable.o -DTEST_MAIN
       
    29 
       
    30 
       
    31 
       
    32 
       
    33 
    17 
    34 iec.flex.c: iec.flex
    18 iec.flex.c: iec.flex
    35 	flex -oiec.flex.c iec.flex
    19 	flex -oiec.flex.c iec.flex
    36 
    20 
    37 iec.flex.o: iec.y.hh iec.flex.c
    21 iec.flex.o: iec.y.hh iec.flex.c
    41 	bison -d -v -o iec.y.cc iec.y
    25 	bison -d -v -o iec.y.cc iec.y
    42 
    26 
    43 iec.y.o: iec.y.cc iec.y.hh
    27 iec.y.o: iec.y.cc iec.y.hh
    44 	$(CXX) -c iec.y.cc $(CFLAGS)
    28 	$(CXX) -c iec.y.cc $(CFLAGS)
    45 
    29 
    46 
       
    47 noerrorcheck: iec.y
    30 noerrorcheck: iec.y
    48 	sed '/ERROR_CHECK_BEGIN/,/ERROR_CHECK_END/ d' iec.y > iec.noerrorcheck.y
    31 	sed '/ERROR_CHECK_BEGIN/,/ERROR_CHECK_END/ d' iec.y > iec.noerrorcheck.y
    49 	flex -oiec.flex.c iec.flex
    32 	flex -oiec.flex.c iec.flex
    50 	$(CXX) -c iec.flex.c -D DEFAULT_LIBDIR='"$(IECLIBDIR)"' $(CFLAGS)
    33 	$(CXX) -c iec.flex.c -D DEFAULT_LIBDIR='"$(IECLIBDIR)"' $(CFLAGS)
    51 	bison -d -v -o iec.y.cc iec.noerrorcheck.y
    34 	bison -d -v -o iec.y.cc iec.noerrorcheck.y
    52 	$(CXX) -c iec.y.cc $(CFLAGS)
    35 	$(CXX) -c iec.y.cc $(CFLAGS)
    53 
    36 
    54 
       
    55 
       
    56 
       
    57 #how to make things from other directories if they are missing
    37 #how to make things from other directories if they are missing
    58 ../% /%:
    38 ../% /%:
    59 	$(MAKE) -C $(@D) $(@F)
    39 	$(MAKE) -C $(@D) $(@F)
    60 
    40 
    61 
    41 
    62 Makefile.depend depend:
    42 Makefile.depend depend:
    63 	$(CXX) -MM -MG -I. *.cc \
    43 	$(CXX) -MM -MG -I. *.cc > Makefile.depend
    64 	  | perl -pe 's/:/ Makefile.depend:/' > Makefile.depend
    44 	#| perl -pe 's/:/ Makefile.depend:/' > Makefile.depend
    65 
    45 
    66 include Makefile.depend
    46 include Makefile.depend
    67 
    47