allow changing code generators, make "help" target default dol_make
authorSebastian <basti@sraa.de>
Wed, 21 Aug 2013 13:50:39 +0000 (15:50 +0200)
committerSebastian <basti@sraa.de>
Wed, 21 Aug 2013 13:50:39 +0000 (15:50 +0200)
dol_example1/Makefile

index 0d34d517cd824032a4201af6ec6daf5ea3f479f0..b35676bf563223f55ae997cee3c5f36975d90a9a 100644 (file)
@@ -5,6 +5,10 @@
 # program to generate
 PROGRAM = example1
 
+# code generator to use
+# use '-C' (SystemC) or '-H' (HdS)
+CODEGEN = -C
+
 # change according to your system
 DOLPATH     = $(HOME)/dol/bin
 SYSTEMC_INC = $(HOME)/systemc/include
@@ -22,22 +26,22 @@ RM  ?= rm
 # don't change anything below
 # ===========================================================================
 
-SRCPATH   = systemc
+SRCPATH   = generated
 CLASSPATH = $(DOLPATH)/dol.jar:$(DOLPATH)/jdom.jar:$(DOLPATH)/xercesImpl.jar
-.PHONY : all help run systemc dotty clean 
-
-all: $(PROGRAM)
+.PHONY : help all run codegen dotty clean 
 
 help:
        @$(ECHO) "Target List:\n" \
-               "\thelp    -- show this help\n" \
-               "\tall     -- generate '$(PROGRAM)' [default]\n" \
+               "\thelp    -- show this help [default]\n" \
+               "\tall     -- generate '$(PROGRAM)'\n" \
                "\trun     -- generate and run '$(PROGRAM)'\n" \
-               "\tsystemc -- generate SystemC code, but do not compile\n" \
+               "\tcodegen -- generate code, but do not compile\n" \
                "\tdotty   -- show flattened process network using DOTTY\n" \
                "\tclean   -- clean generated files\n"
                 
-systemc: $(SRCPATH)/src/Makefile.new
+all: $(PROGRAM)
+
+codegen: $(SRCPATH)/src/Makefile.new
 
 run: $(PROGRAM)
        @$(ECHO) "\t[RUN]\t$^"
@@ -67,7 +71,7 @@ $(SRCPATH)/src/Makefile.new: $(SRCPATH)/src/Makefile
 $(SRCPATH)/src/Makefile: $(PROGRAM)_flattened.xml
        @$(ECHO) "\t[GEN]\t$@"
        @$(JAVA) -cp $(CLASSPATH) dol.main.Main -P $(PROGRAM)_flattened.xml \
-               -C $(SRCPATH) -c >/dev/null
+               $(CODEGEN) $(SRCPATH) -c >/dev/null
        
 $(PROGRAM)_flattened.xml: $(PROGRAM).xml
        @$(ECHO) "\t[FLAT]\t$^"