aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-05-26 11:17:50 +0200
committerClifford Wolf <clifford@clifford.at>2018-05-26 11:17:50 +0200
commit1338f0f9ebc1748d93ac331d277f2fd0c2cb30b4 (patch)
tree136b7027c50a13baa26936810605e4706273e9d6
parent5e48758b30caf8ecc91c3c416326a093b47a2e2d (diff)
downloadnextpnr-1338f0f9ebc1748d93ac331d277f2fd0c2cb30b4.tar.gz
nextpnr-1338f0f9ebc1748d93ac331d277f2fd0c2cb30b4.tar.bz2
nextpnr-1338f0f9ebc1748d93ac331d277f2fd0c2cb30b4.zip
Add Makefile
Signed-off-by: Clifford Wolf <clifford@clifford.at>
-rw-r--r--.gitignore3
-rw-r--r--Makefile30
-rw-r--r--common/design.cc21
-rw-r--r--common/design.h2
-rw-r--r--dummy/chip.cc19
-rw-r--r--dummy/chip.h2
-rw-r--r--dummy/main.cc21
7 files changed, 94 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 69ff7396..f422c7f0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
-/demo
+/build/
+/nextpnr-dummy
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..2ddcb724
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,30 @@
+archs = dummy
+common_objs = design.o
+dummy_objs = chip.o main.o
+
+CXX = clang
+CXXFLAGS = -ggdb -MD -std=c++11 -O2 -Icommon
+LDFLAGS = -ggdb
+LDLIBS = -lstdc++
+
+define binaries
+all:: nextpnr-$(1)
+
+nextpnr-$(1): $$(addprefix build/$(1)-common-,$$(common_objs)) $$(addprefix build/$(1)-arch-,$$($(1)_objs))
+ $$(CXX) -o $$@ $$(LDFLAGS) -I$(1) $$^ $$(LDLIBS)
+
+build/$(1)-common-%.o: common/%.cc
+ @mkdir -p build
+ $$(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
+ $$(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
+
+-include build/*.d
diff --git a/common/design.cc b/common/design.cc
new file mode 100644
index 00000000..7ba6a9b1
--- /dev/null
+++ b/common/design.cc
@@ -0,0 +1,21 @@
+/*
+ * nextpnr -- Next Generation Place and Route
+ *
+ * Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#include "design.h"
+
diff --git a/common/design.h b/common/design.h
index 421937eb..1b45895e 100644
--- a/common/design.h
+++ b/common/design.h
@@ -1,5 +1,5 @@
/*
- * nextpnr -- Next Generation PnR
+ * nextpnr -- Next Generation Place and Route
*
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
*
diff --git a/dummy/chip.cc b/dummy/chip.cc
index 58b55ec9..df7590ee 100644
--- a/dummy/chip.cc
+++ b/dummy/chip.cc
@@ -1,3 +1,22 @@
+/*
+ * nextpnr -- Next Generation Place and Route
+ *
+ * Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
#include "chip.h"
Chip::Chip(ChipArgs)
diff --git a/dummy/chip.h b/dummy/chip.h
index 07202e22..ec497e0e 100644
--- a/dummy/chip.h
+++ b/dummy/chip.h
@@ -1,5 +1,5 @@
/*
- * nextpnr -- Next Generation PnR
+ * nextpnr -- Next Generation Place and Route
*
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
*
diff --git a/dummy/main.cc b/dummy/main.cc
index 01050d24..e3a784ca 100644
--- a/dummy/main.cc
+++ b/dummy/main.cc
@@ -1,4 +1,23 @@
-#include "database.h"
+/*
+ * nextpnr -- Next Generation Place and Route
+ *
+ * Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#include "design.h"
int main()
{