aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-05-26 14:27:21 +0200
committerClifford Wolf <clifford@clifford.at>2018-05-26 14:27:28 +0200
commit1899833b4db65e506746926831c323a8a8923fc4 (patch)
tree715a3133e699323da2476aa3ba0980fd745e6289 /Makefile
parent1338f0f9ebc1748d93ac331d277f2fd0c2cb30b4 (diff)
downloadnextpnr-1899833b4db65e506746926831c323a8a8923fc4.tar.gz
nextpnr-1899833b4db65e506746926831c323a8a8923fc4.tar.bz2
nextpnr-1899833b4db65e506746926831c323a8a8923fc4.zip
Start work on iCE40 chipdb
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 13 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 2ddcb724..fd669ba7 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,11 @@ archs = dummy
common_objs = design.o
dummy_objs = chip.o main.o
+all::
+clean::
+
+include ice40/makefile.inc
+
CXX = clang
CXXFLAGS = -ggdb -MD -std=c++11 -O2 -Icommon
LDFLAGS = -ggdb
@@ -10,21 +15,21 @@ LDLIBS = -lstdc++
define binaries
all:: nextpnr-$(1)
-nextpnr-$(1): $$(addprefix build/$(1)-common-,$$(common_objs)) $$(addprefix build/$(1)-arch-,$$($(1)_objs))
+nextpnr-$(1): $$(addprefix objs/$(1)-common-,$$(common_objs)) $$(addprefix objs/$(1)-arch-,$$($(1)_objs))
$$(CXX) -o $$@ $$(LDFLAGS) -I$(1) $$^ $$(LDLIBS)
-build/$(1)-common-%.o: common/%.cc
- @mkdir -p build
+objs/$(1)-common-%.o: common/%.cc
+ @mkdir -p objs
$$(CXX) -c -o $$@ -D$$(shell echo arch_$(1) | tr a-z A-Z) $$(CXXFLAGS) -I$(1) $$<
-build/$(1)-arch-%.o: $(1)/%.cc
- @mkdir -p build
+objs/$(1)-arch-%.o: $(1)/%.cc
+ @mkdir -p objs
$$(CXX) -c -o $$@ -D$$(shell echo arch_$(1) | tr a-z A-Z) $$(CXXFLAGS) -I$(1) $$<
endef
$(foreach arch,$(archs),$(eval $(call binaries,$(arch))))
-clean:
- rm -rf $(addprefix nextpnr-,$(archs)) build
+clean::
+ rm -rf $(addprefix nextpnr-,$(archs)) objs
--include build/*.d
+-include objs/*.d