aboutsummaryrefslogtreecommitdiffstats
path: root/icetime
diff options
context:
space:
mode:
authorRobert Ou <rqou@robertou.com>2017-11-15 03:13:35 -0800
committerRobert Ou <rqou@robertou.com>2017-11-15 03:13:35 -0800
commit05440e4d62f9b0c242c1c040cb864ffe49a6908d (patch)
treed5394e928dc4831292207109154c3d4a6ec422cd /icetime
parent539cf999dd7fe0a837b72af83c4b1c335b6eafe4 (diff)
downloadicestorm-05440e4d62f9b0c242c1c040cb864ffe49a6908d.tar.gz
icestorm-05440e4d62f9b0c242c1c040cb864ffe49a6908d.tar.bz2
icestorm-05440e4d62f9b0c242c1c040cb864ffe49a6908d.zip
Fix up build system to work with emscripten
Diffstat (limited to 'icetime')
-rw-r--r--icetime/Makefile18
1 files changed, 17 insertions, 1 deletions
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