stage1_2/Makefile
changeset 353 17bffb57a8c5
parent 352 4baeb6d13173
child 354 0f24db96b519
equal deleted inserted replaced
352:4baeb6d13173 353:17bffb57a8c5
     1 # matiec - a compiler for the programming languages defined in IEC 61131-3
       
     2 #
       
     3 # Copyright (C) 2003-2011  Mario de Sousa (msousa@fe.up.pt)
       
     4 # Copyright (C) 2007-2011  Laurent Bessard and Edouard Tisserant
       
     5 #
       
     6 # This program is free software: you can redistribute it and/or modify
       
     7 # it under the terms of the GNU General Public License as published by
       
     8 # the Free Software Foundation, either version 3 of the License, or
       
     9 # (at your option) any later version.
       
    10 #
       
    11 # This program is distributed in the hope that it will be useful,
       
    12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    14 # GNU General Public License for more details.
       
    15 #
       
    16 # You should have received a copy of the GNU General Public License
       
    17 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
       
    18 
       
    19 # include the system specific Makefile
       
    20 include ../Makefile.$(shell uname)
       
    21 
       
    22 
       
    23 
       
    24 default: all
       
    25 
       
    26 all: iec.flex.o iec.y.o stage1_2.o
       
    27 
       
    28 clean:
       
    29 	echo > Makefile.depend
       
    30 	-rm -f iec.flex.c iec.y.cc iec.y.hh iec.y.output
       
    31 	-rm -f iec.noerrorcheck.y
       
    32 	-rm -f test_flex
       
    33 	-rm -f stage1_2.o
       
    34 	-rm -f iec.y.o
       
    35 	-rm -f iec.flex.o
       
    36 	-rm -f Makefile.depend
       
    37 
       
    38 
       
    39 CFLAGS += -I. -I../* -I../../absyntax
       
    40 
       
    41 iec.flex.c: iec.flex
       
    42 	flex -oiec.flex.c iec.flex
       
    43 
       
    44 stage1_2.cc: iec.y.hh 
       
    45 stage1_2.o: stage1_2.cc
       
    46 
       
    47 iec.flex.o: iec.y.hh iec.flex.c
       
    48 	$(CXX) -c iec.flex.c -D DEFAULT_LIBDIR='"$(IECLIBDIR)"' $(CFLAGS)
       
    49 
       
    50 iec.y.hh iec.y.cc: iec.y
       
    51 	bison -d -v -o iec.y.cc iec.y
       
    52 
       
    53 iec.y.o: iec.y.cc iec.y.hh
       
    54 	$(CXX) -c iec.y.cc $(CFLAGS)
       
    55 
       
    56 noerrorcheck: iec.y
       
    57 	sed '/ERROR_CHECK_BEGIN/,/ERROR_CHECK_END/ d' iec.y > iec.noerrorcheck.y
       
    58 	flex -oiec.flex.c iec.flex
       
    59 	$(CXX) -c iec.flex.c -D DEFAULT_LIBDIR='"$(IECLIBDIR)"' $(CFLAGS)
       
    60 	bison -d -v -o iec.y.cc iec.noerrorcheck.y
       
    61 	$(CXX) -c iec.y.cc $(CFLAGS)
       
    62 
       
    63 #how to make things from other directories if they are missing
       
    64 ../% /%:
       
    65 	$(MAKE) -C $(@D) $(@F)
       
    66 
       
    67 
       
    68 Makefile.depend depend:
       
    69 	$(CXX) -MM -MG -I. *.cc \
       
    70 	  | sed 's/:/ Makefile.depend:/' > Makefile.depend
       
    71 
       
    72 include Makefile.depend
       
    73 
       
    74