2020-11-01 04:04:29 +00: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))
|
|
|
|
|
2020-11-02 06:36:32 +00:00
|
|
|
override LIBS += $(shell pkg-config --libs bdw-gc)
|
|
|
|
override INCLUDES += $(shell pkg-config --cflags bdw-gc)
|
|
|
|
|
2020-11-01 04:04:29 +00:00
|
|
|
all: multiclip
|
|
|
|
|
|
|
|
$(ABLEC_JAR): $(GRAMMAR_SOURCES)
|
|
|
|
touch $(wildcard $(ARTIFACT)/*.sv)
|
|
|
|
silver-ableC -o $@ $(SVFLAGS) $(ARTIFACT)
|
|
|
|
|
|
|
|
multiclip: main.c
|
2020-11-02 06:36:32 +00:00
|
|
|
gcc -o $@ $(LIBS) $(INCLUDES) $<
|
2020-11-01 04:04:29 +00:00
|
|
|
|
|
|
|
main.c: main.xc $(ABLEC_JAR)
|
2020-11-02 06:36:32 +00:00
|
|
|
java -jar $(ABLEC_JAR) $< $(XCFLAGS)
|
2020-11-01 04:04:29 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f multiclip
|
|
|
|
rm -f *.gen_cpp
|
|
|
|
rm -f *.c
|
|
|
|
rm -f *.xml
|
|
|
|
|
|
|
|
.PHONY: all clean
|