From 05440e4d62f9b0c242c1c040cb864ffe49a6908d Mon Sep 17 00:00:00 2001 From: Robert Ou Date: Wed, 15 Nov 2017 03:13:35 -0800 Subject: Fix up build system to work with emscripten --- icetime/Makefile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'icetime') diff --git a/icetime/Makefile b/icetime/Makefile index 5e959c7..d058153 100644 --- a/icetime/Makefile +++ b/icetime/Makefile @@ -8,6 +8,22 @@ endif all: icetime$(EXE) +ifeq ($(EXE),.js) +icetime$(EXE): | share/$(CHIPDB_SUBDIR)/chipdb-384.txt share/$(CHIPDB_SUBDIR)/chipdb-1k.txt share/$(CHIPDB_SUBDIR)/chipdb-8k.txt + +share/$(CHIPDB_SUBDIR)/chipdb-384.txt: ../icebox/chipdb-384.txt + mkdir -p share/$(CHIPDB_SUBDIR) + cp $< $@ +share/$(CHIPDB_SUBDIR)/chipdb-1k.txt: ../icebox/chipdb-1k.txt + mkdir -p share/$(CHIPDB_SUBDIR) + cp $< $@ +share/$(CHIPDB_SUBDIR)/chipdb-8k.txt: ../icebox/chipdb-8k.txt + mkdir -p share/$(CHIPDB_SUBDIR) + cp $< $@ + +override LDFLAGS += --embed-file share +endif + icetime$(EXE): icetime.o $(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS) @@ -46,7 +62,7 @@ test: test0 test1 test2 test3 test4 test5 test6 test7 test8 test9 show: show0 show1 show2 show3 show4 show5 show6 show7 show8 show9 clean: - rm -f icetime icetime.exe timings.inc *.o *.d + rm -f icetime$(EXE) icetime.exe timings.inc *.o *.d rm -rf test[0-9]* -include *.d -- cgit v1.2.3