etisserant@0: # include the system specific Makefile
etisserant@40: include Makefile.$(shell uname)
etisserant@40: 
etisserant@0: default: all
etisserant@0: 
lbessard@70: all: iec2c iec2iec
etisserant@0: 
etisserant@0: install: all
etisserant@0: 	install -d $(INSTALL_PREDIR)/$(INSTALL_BINDIR)/ 
etisserant@0: 	install -d $(INSTALL_PREDIR)/$(IECLIBDIR)/
lbessard@70: 	install iec2c    $(INSTALL_PREDIR)/$(INSTALL_BINDIR)/
etisserant@0: 	install lib/*.txt $(INSTALL_PREDIR)/$(IECLIBDIR)/
etisserant@0: #	install iec2iec   $(INSTALL_PREDIR)/$(INSTALL_BINDIR)/
etisserant@0: 
etisserant@0: 
etisserant@0: uninstall:
lbessard@70: 	rm -f $(INSTALL_PREDIR)/$(INSTALL_BINDIR)/iec2c
etisserant@0: 	rm -f $(INSTALL_PREDIR)/$(INSTALL_BINDIR)/iec2iec
etisserant@0: 	for ff in `cd lib; ls *.txt; cd ..` do echo $$ff done
etisserant@0: #	for ff in `cd lib; ls *.txt; cd ..` do rm -f $(INSTALL_PREDIR)/$(IECLIBDIR)/$$ff done
etisserant@0: 
etisserant@0: 
etisserant@0: clean:
lbessard@70: 	-rm -f iec2iec iec2c *.o absyntax/*.o Makefile.depend
etisserant@0: # make something everywhere (ie, in all Makefiles that have that target)
etisserant@0: 	find . -depth -mindepth 2 -maxdepth 2 -name Makefile -printf %h\\n | xargs -i make -C{} $@
etisserant@0: 
etisserant@0: CXXFLAGS += -I.
etisserant@0: 
etisserant@0: LIBS  = absyntax/absyntax.o absyntax/visitor.o
mario@15: LIBS += stage1_2/stage1_2.o stage1_2/iec.y.o stage1_2/iec.flex.o 
etisserant@0: 
lbessard@70: iec2c: main.o stage4/generate_c/generate_c.o stage4/stage4.o $(LIBS)
lbessard@70: 	$(CXX) -o iec2c main.o stage4/stage4.o stage4/generate_c/generate_c.o $(LIBS)
etisserant@0: 
etisserant@0: 
etisserant@0: iec2iec: main.o stage4/generate_iec/generate_iec.o stage4/stage4.o $(LIBS)
etisserant@0: 	$(CXX) -o iec2iec main.o stage4/stage4.o stage4/generate_iec/generate_iec.o $(LIBS)
etisserant@0: 
etisserant@0: 
etisserant@0: #how to make things in subdirectories etc
etisserant@0: ../% /% absyntax/% stage1_2/% stage3/% stage4/% util/%:
etisserant@0: 	$(MAKE) -C $(@D) $(@F)
etisserant@0: 
etisserant@0: Makefile.depend depend:
etisserant@0: 	$(CXX) -MM -MG -I. *.cc \
etisserant@0: 	  | perl -pe 's/:/ Makefile.depend:/' > Makefile.depend
etisserant@0: 
etisserant@0: include Makefile.depend
etisserant@0: 
etisserant@0: 
etisserant@0: 
etisserant@0: