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 <http://www.gnu.org/licenses/>.
Edouard@279: 
etisserant@0: # include the system specific Makefile
etisserant@40: include ../Makefile.$(shell uname)
etisserant@0: 
etisserant@0: 
etisserant@0: 
msousa@257: default: all
etisserant@0: 
mario@15: all: iec.flex.o iec.y.o stage1_2.o
mario@15: 
etisserant@0: clean:
etisserant@159: 	echo > Makefile.depend
etisserant@0: 	-rm -f iec.flex.c iec.y.cc iec.y.hh iec.y.output
mario@68: 	-rm -f iec.noerrorcheck.y
etisserant@0: 	-rm -f test_flex
etisserant@172: 	-rm -f stage1_2.o
etisserant@172: 	-rm -f iec.y.o
etisserant@172: 	-rm -f iec.flex.o
msousa@258: 	-rm -f Makefile.depend
etisserant@172: 
etisserant@0: 
etisserant@0: CFLAGS += -I. -I../* -I../../absyntax
etisserant@0: 
etisserant@0: iec.flex.c: iec.flex
etisserant@0: 	flex -oiec.flex.c iec.flex
etisserant@0: 
msousa@258: stage1_2.cc: iec.y.hh 
msousa@258: stage1_2.o: stage1_2.cc
etisserant@172: 
etisserant@0: iec.flex.o: iec.y.hh iec.flex.c
etisserant@40: 	$(CXX) -c iec.flex.c -D DEFAULT_LIBDIR='"$(IECLIBDIR)"' $(CFLAGS)
etisserant@0: 
etisserant@0: iec.y.hh iec.y.cc: iec.y
etisserant@0: 	bison -d -v -o iec.y.cc iec.y
etisserant@0: 
etisserant@0: iec.y.o: iec.y.cc iec.y.hh
etisserant@40: 	$(CXX) -c iec.y.cc $(CFLAGS)
etisserant@0: 
mario@68: noerrorcheck: iec.y
mario@68: 	sed '/ERROR_CHECK_BEGIN/,/ERROR_CHECK_END/ d' iec.y > iec.noerrorcheck.y
mario@68: 	flex -oiec.flex.c iec.flex
mario@68: 	$(CXX) -c iec.flex.c -D DEFAULT_LIBDIR='"$(IECLIBDIR)"' $(CFLAGS)
mario@68: 	bison -d -v -o iec.y.cc iec.noerrorcheck.y
mario@68: 	$(CXX) -c iec.y.cc $(CFLAGS)
mario@68: 
etisserant@0: #how to make things from other directories if they are missing
etisserant@0: ../% /%:
etisserant@0: 	$(MAKE) -C $(@D) $(@F)
mario@15: 
mario@15: 
mario@15: Makefile.depend depend:
Lolitech@243: 	$(CXX) -MM -MG -I. *.cc \
Lolitech@243: 	  | sed 's/:/ Makefile.depend:/' > Makefile.depend
mario@15: 
mario@15: include Makefile.depend
mario@15: 
Lolitech@243: