stage1_2/Makefile
changeset 258 d7d92b2f87e9
parent 257 90782e241346
parent 243 bdfee1f5be9e
child 279 c0453b7f99df
--- a/stage1_2/Makefile	Wed Mar 30 19:53:32 2011 +0100
+++ b/stage1_2/Makefile	Thu Mar 31 10:45:34 2011 +0100
@@ -8,12 +8,14 @@
 all: iec.flex.o iec.y.o stage1_2.o
 
 clean:
+	echo > Makefile.depend
 	-rm -f iec.flex.c iec.y.cc iec.y.hh iec.y.output
 	-rm -f iec.noerrorcheck.y
 	-rm -f test_flex
 	-rm -f stage1_2.o
 	-rm -f iec.y.o
 	-rm -f iec.flex.o
+	-rm -f Makefile.depend
 
 
 CFLAGS += -I. -I../* -I../../absyntax
@@ -21,7 +23,8 @@
 iec.flex.c: iec.flex
 	flex -oiec.flex.c iec.flex
 
-stage1_2.o: stage1_2.cc iec.y.hh 
+stage1_2.cc: iec.y.hh 
+stage1_2.o: stage1_2.cc
 
 iec.flex.o: iec.y.hh iec.flex.c
 	$(CXX) -c iec.flex.c -D DEFAULT_LIBDIR='"$(IECLIBDIR)"' $(CFLAGS)
@@ -43,3 +46,11 @@
 ../% /%:
 	$(MAKE) -C $(@D) $(@F)
 
+
+Makefile.depend depend:
+	$(CXX) -MM -MG -I. *.cc \
+	  | sed 's/:/ Makefile.depend:/' > Makefile.depend
+
+include Makefile.depend
+
+