Makefile
changeset 0 fb772792efd1
child 15 0b472e25eb16
equal deleted inserted replaced
-1:000000000000 0:fb772792efd1
       
     1 # include the system specific Makefile
       
     2 #include ../../Makefile.$(shell uname)
       
     3  
       
     4 default: all
       
     5 
       
     6 all: iec2cc iec2iec
       
     7 
       
     8 install: all
       
     9 	install -d $(INSTALL_PREDIR)/$(INSTALL_BINDIR)/ 
       
    10 	install -d $(INSTALL_PREDIR)/$(IECLIBDIR)/
       
    11 	install iec2cc    $(INSTALL_PREDIR)/$(INSTALL_BINDIR)/
       
    12 	install lib/*.txt $(INSTALL_PREDIR)/$(IECLIBDIR)/
       
    13 #	install iec2iec   $(INSTALL_PREDIR)/$(INSTALL_BINDIR)/
       
    14 
       
    15 
       
    16 uninstall:
       
    17 	rm -f $(INSTALL_PREDIR)/$(INSTALL_BINDIR)/iec2cc
       
    18 	rm -f $(INSTALL_PREDIR)/$(INSTALL_BINDIR)/iec2iec
       
    19 	for ff in `cd lib; ls *.txt; cd ..` do echo $$ff done
       
    20 #	for ff in `cd lib; ls *.txt; cd ..` do rm -f $(INSTALL_PREDIR)/$(IECLIBDIR)/$$ff done
       
    21 
       
    22 
       
    23 clean:
       
    24 	-rm -f iec2iec iec2cc *.o absyntax/*.o Makefile.depend
       
    25 # make something everywhere (ie, in all Makefiles that have that target)
       
    26 	find . -depth -mindepth 2 -maxdepth 2 -name Makefile -printf %h\\n | xargs -i make -C{} $@
       
    27 
       
    28 
       
    29 
       
    30 #get warnings, debugging information and optimization
       
    31 CXXFLAGS  = -Wall -pedantic -Wpointer-arith -Wwrite-strings
       
    32 # CXXFLAGS += -Werror
       
    33 CXXFLAGS += -ggdb -O3 -funroll-loops
       
    34 # Note: if the optimizer crashes, we'll leave out the -O3 for those files
       
    35 
       
    36 CXXFLAGS += -I.
       
    37 
       
    38 
       
    39 
       
    40 LIBS  = absyntax/absyntax.o absyntax/visitor.o
       
    41 LIBS += stage1_2/iec.y.o stage1_2/iec.flex.o
       
    42 
       
    43 iec2cc: main.o stage4/generate_cc/generate_cc.o stage4/stage4.o $(LIBS)
       
    44 	$(CXX) -o iec2cc main.o stage4/stage4.o stage4/generate_cc/generate_cc.o $(LIBS)
       
    45 
       
    46 
       
    47 iec2iec: main.o stage4/generate_iec/generate_iec.o stage4/stage4.o $(LIBS)
       
    48 	$(CXX) -o iec2iec main.o stage4/stage4.o stage4/generate_iec/generate_iec.o $(LIBS)
       
    49 
       
    50 
       
    51 #how to make things in subdirectories etc
       
    52 ../% /% absyntax/% stage1_2/% stage3/% stage4/% util/%:
       
    53 	$(MAKE) -C $(@D) $(@F)
       
    54 
       
    55 Makefile.depend depend:
       
    56 	$(CXX) -MM -MG -I. *.cc \
       
    57 	  | perl -pe 's/:/ Makefile.depend:/' > Makefile.depend
       
    58 
       
    59 include Makefile.depend
       
    60 
       
    61 
       
    62 
       
    63