Edouard@279: # matiec - a compiler for the programming languages defined in IEC 61131-3 Edouard@279: # Edouard@279: # Copyright (C) 2003-2011 Mario de Sousa (msousa@fe.up.pt) Edouard@279: # Copyright (C) 2007-2011 Laurent Bessard and Edouard Tisserant Edouard@279: # Edouard@279: # This program is free software: you can redistribute it and/or modify Edouard@279: # it under the terms of the GNU General Public License as published by Edouard@279: # the Free Software Foundation, either version 3 of the License, or Edouard@279: # (at your option) any later version. Edouard@279: # Edouard@279: # This program is distributed in the hope that it will be useful, Edouard@279: # but WITHOUT ANY WARRANTY; without even the implied warranty of Edouard@279: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Edouard@279: # GNU General Public License for more details. Edouard@279: # Edouard@279: # You should have received a copy of the GNU General Public License Edouard@279: # along with this program. If not, see . Edouard@279: 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) msousa@340: find . -depth -mindepth 2 -maxdepth 2 -name Makefile | sed 's/Makefile//g' | xargs -I {} $(MAKE) -C{} clean 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 \ Lolitech@243: | sed 's/:/ Makefile.depend:/' > Makefile.depend etisserant@0: etisserant@0: include Makefile.depend etisserant@0: etisserant@0: etisserant@0: