multiclip/Makefile

34 lines
769 B
Makefile
Raw Normal View History

2020-10-31 23:04:29 -05:00
ABLEC_BASE ?= ~/Projects/melt-umn/ableC
EXTS_BASE ?= ~/Projects/melt-umn/extensions
ABLEC_JAR = ableC.jar
ARTIFACT = artifact
GRAMMAR_DIRS = $(ABLEC_BASE)/grammars $(wildcard $(EXTS_BASE)/*/grammars)
GRAMMAR_SOURCES = $(shell find $(GRAMMAR_DIRS) -name *.sv -print0 | xargs -0)
XC_INCLUDE_DIRS = $(wildcard $(EXTS_BASE)/*/include)
override XCFLAGS += $(addprefix -I,$(XC_INCLUDE_DIRS))
override SVFLAGS += $(addprefix -I ,$(GRAMMAR_DIRS))
all: multiclip
$(ABLEC_JAR): $(GRAMMAR_SOURCES)
touch $(wildcard $(ARTIFACT)/*.sv)
silver-ableC -o $@ $(SVFLAGS) $(ARTIFACT)
multiclip: main.c
gcc -o $@ -lgc $<
main.c: main.xc $(ABLEC_JAR)
java -jar $(ABLEC_JAR) $< -o $@ $(XCFLAGS)
clean:
rm -f multiclip
rm -f *.gen_cpp
rm -f *.c
rm -f *.xml
.PHONY: all clean