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:
etisserant@159: 	-rm -f iec2iec iec2c *.o absyntax/*.o
etisserant@159: 	echo > 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@181: LIBS += stage1_2/stage1_2.o stage1_2/iec.y.o stage1_2/iec.flex.o
ccb@202: LIBS += stage3/stage3.o
ccb@202: LIBS += stage3/visit_expression_type.o
mario@181: LIBS += absyntax_utils/absyntax_utils.o
mario@181: LIBS += absyntax_utils/search_expression_type.o
mario@181: LIBS += absyntax_utils/decompose_var_instance_name.o
mario@181: LIBS += absyntax_utils/function_call_iterator.o
mario@181: LIBS += absyntax_utils/function_call_param_iterator.o
mario@181: LIBS += absyntax_utils/function_param_iterator.o
mario@181: LIBS += absyntax_utils/search_base_type.o
mario@181: LIBS += absyntax_utils/search_constant_type.o
mario@181: LIBS += absyntax_utils/search_fb_instance_decl.o
mario@181: LIBS += absyntax_utils/search_fb_typedecl.o
mario@181: LIBS += absyntax_utils/search_varfb_instance_type.o
mario@181: LIBS += absyntax_utils/search_var_instance_decl.o
mario@181: LIBS += absyntax_utils/spec_init_separator.o
mario@181: LIBS += absyntax_utils/type_initial_value.o
ccb@202: LIBS += absyntax_utils/add_en_eno_param_decl.o
ccb@202: LIBS += absyntax_utils/get_sizeof_datatype.o
mario@181: LIBS += absyntax_utils/get_function_type.o
mario@181: 
mario@181: 
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: