From 917afd1a853599034b101c9e035ee690560b46fa Mon Sep 17 00:00:00 2001
From: Robert Ou <rqou@robertou.com>
Date: Sun, 16 Jul 2017 18:51:54 -0700
Subject: makefile: Do not ignore user-provided CFLAGS

---
 config.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/config.mk b/config.mk
index aeb525f..364f8bc 100644
--- a/config.mk
+++ b/config.mk
@@ -1,8 +1,8 @@
 CXX ?= clang++
 CC ?= clang
 LDLIBS = -lm -lstdc++
-CFLAGS = -MD -O0 -ggdb -Wall -std=c99 -I/usr/local/include
-CXXFLAGS = -MD -O0 -ggdb -Wall -std=c++11 -I/usr/local/include
+CFLAGS += -MD -O0 -ggdb -Wall -std=c99 -I/usr/local/include
+CXXFLAGS += -MD -O0 -ggdb -Wall -std=c++11 -I/usr/local/include
 PKG_CONFIG ?= pkg-config
 DESTDIR ?=
 PREFIX ?= /usr/local
-- 
cgit v1.2.3


From 4111f9cca58fb9fd9ed1858ac56524eff294ff11 Mon Sep 17 00:00:00 2001
From: Robert Ou <rqou@robertou.com>
Date: Sun, 16 Jul 2017 20:52:58 -0700
Subject: makefile: Make install target work for Windows

---
 icebox/Makefile   | 32 ++++++++++++++++----------------
 icebram/Makefile  |  4 ++--
 icemulti/Makefile |  4 ++--
 icepack/Makefile  |  8 ++++----
 icepll/Makefile   |  4 ++--
 iceprog/Makefile  |  4 ++--
 icetime/Makefile  |  4 ++--
 7 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/icebox/Makefile b/icebox/Makefile
index 446fb18..afeb13c 100644
--- a/icebox/Makefile
+++ b/icebox/Makefile
@@ -26,26 +26,26 @@ install: all
 	cp chipdb-8k.txt     $(DESTDIR)$(PREFIX)/share/icebox/
 	cp icebox.py         $(DESTDIR)$(PREFIX)/bin/icebox.py
 	cp iceboxdb.py       $(DESTDIR)$(PREFIX)/bin/iceboxdb.py
-	cp icebox_chipdb.py  $(DESTDIR)$(PREFIX)/bin/icebox_chipdb
-	cp icebox_diff.py    $(DESTDIR)$(PREFIX)/bin/icebox_diff
-	cp icebox_explain.py $(DESTDIR)$(PREFIX)/bin/icebox_explain
-	cp icebox_colbuf.py  $(DESTDIR)$(PREFIX)/bin/icebox_colbuf
-	cp icebox_html.py    $(DESTDIR)$(PREFIX)/bin/icebox_html
-	cp icebox_maps.py    $(DESTDIR)$(PREFIX)/bin/icebox_maps
-	cp icebox_vlog.py    $(DESTDIR)$(PREFIX)/bin/icebox_vlog
-	cp icebox_stat.py    $(DESTDIR)$(PREFIX)/bin/icebox_stat
+	cp icebox_chipdb.py  $(DESTDIR)$(PREFIX)/bin/icebox_chipdb$(PY_EXE)
+	cp icebox_diff.py    $(DESTDIR)$(PREFIX)/bin/icebox_diff$(PY_EXE)
+	cp icebox_explain.py $(DESTDIR)$(PREFIX)/bin/icebox_explain$(PY_EXE)
+	cp icebox_colbuf.py  $(DESTDIR)$(PREFIX)/bin/icebox_colbuf$(PY_EXE)
+	cp icebox_html.py    $(DESTDIR)$(PREFIX)/bin/icebox_html$(PY_EXE)
+	cp icebox_maps.py    $(DESTDIR)$(PREFIX)/bin/icebox_maps$(PY_EXE)
+	cp icebox_vlog.py    $(DESTDIR)$(PREFIX)/bin/icebox_vlog$(PY_EXE)
+	cp icebox_stat.py    $(DESTDIR)$(PREFIX)/bin/icebox_stat$(PY_EXE)
 
 uninstall:
 	rm -f $(DESTDIR)$(PREFIX)/bin/icebox.py
 	rm -f $(DESTDIR)$(PREFIX)/bin/iceboxdb.py
-	rm -f $(DESTDIR)$(PREFIX)/bin/icebox_chipdb
-	rm -f $(DESTDIR)$(PREFIX)/bin/icebox_diff
-	rm -f $(DESTDIR)$(PREFIX)/bin/icebox_explain
-	rm -f $(DESTDIR)$(PREFIX)/bin/icebox_colbuf
-	rm -f $(DESTDIR)$(PREFIX)/bin/icebox_html
-	rm -f $(DESTDIR)$(PREFIX)/bin/icebox_maps
-	rm -f $(DESTDIR)$(PREFIX)/bin/icebox_vlog
-	rm -f $(DESTDIR)$(PREFIX)/bin/icebox_stat
+	rm -f $(DESTDIR)$(PREFIX)/bin/icebox_chipdb$(PY_EXE)
+	rm -f $(DESTDIR)$(PREFIX)/bin/icebox_diff$(PY_EXE)
+	rm -f $(DESTDIR)$(PREFIX)/bin/icebox_explain$(PY_EXE)
+	rm -f $(DESTDIR)$(PREFIX)/bin/icebox_colbuf$(PY_EXE)
+	rm -f $(DESTDIR)$(PREFIX)/bin/icebox_html$(PY_EXE)
+	rm -f $(DESTDIR)$(PREFIX)/bin/icebox_maps$(PY_EXE)
+	rm -f $(DESTDIR)$(PREFIX)/bin/icebox_vlog$(PY_EXE)
+	rm -f $(DESTDIR)$(PREFIX)/bin/icebox_stat$(PY_EXE)
 	rm -f $(DESTDIR)$(PREFIX)/share/icebox/chipdb-384.txt
 	rm -f $(DESTDIR)$(PREFIX)/share/icebox/chipdb-1k.txt
 	rm -f $(DESTDIR)$(PREFIX)/share/icebox/chipdb-8k.txt
diff --git a/icebram/Makefile b/icebram/Makefile
index d16b80b..3904926 100644
--- a/icebram/Makefile
+++ b/icebram/Makefile
@@ -14,10 +14,10 @@ test: icebram
 
 install: all
 	mkdir -p $(DESTDIR)$(PREFIX)/bin
-	cp icebram $(DESTDIR)$(PREFIX)/bin/icebram
+	cp icebram$(EXE) $(DESTDIR)$(PREFIX)/bin/icebram$(EXE)
 
 uninstall:
-	rm -f $(DESTDIR)$(PREFIX)/bin/icebram
+	rm -f $(DESTDIR)$(PREFIX)/bin/icebram$(EXE)
 
 clean:
 	rm -f icebram
diff --git a/icemulti/Makefile b/icemulti/Makefile
index a168bac..5302158 100644
--- a/icemulti/Makefile
+++ b/icemulti/Makefile
@@ -11,10 +11,10 @@ icemulti$(EXE): icemulti.o
 
 install: all
 	mkdir -p $(DESTDIR)$(PREFIX)/bin
-	cp icemulti $(DESTDIR)$(PREFIX)/bin/icemulti
+	cp icemulti$(EXE) $(DESTDIR)$(PREFIX)/bin/icemulti$(EXE)
 
 uninstall:
-	rm -f $(DESTDIR)$(PREFIX)/bin/icemulti
+	rm -f $(DESTDIR)$(PREFIX)/bin/icemulti$(EXE)
 
 clean:
 	rm -f icemulti
diff --git a/icepack/Makefile b/icepack/Makefile
index 2578fe0..65d4c9a 100644
--- a/icepack/Makefile
+++ b/icepack/Makefile
@@ -18,12 +18,12 @@ iceunpack.exe:
 
 install: all
 	mkdir -p $(DESTDIR)$(PREFIX)/bin
-	cp icepack $(DESTDIR)$(PREFIX)/bin/icepack
-	ln -sf icepack $(DESTDIR)$(PREFIX)/bin/iceunpack
+	cp icepack$(EXE) $(DESTDIR)$(PREFIX)/bin/icepack$(EXE)
+	ln -sf icepack$(EXE) $(DESTDIR)$(PREFIX)/bin/iceunpack$(EXE)
 
 uninstall:
-	rm -f $(DESTDIR)$(PREFIX)/bin/icepack
-	rm -f $(DESTDIR)$(PREFIX)/bin/iceunpack
+	rm -f $(DESTDIR)$(PREFIX)/bin/icepack$(EXE)
+	rm -f $(DESTDIR)$(PREFIX)/bin/iceunpack$(EXE)
 
 clean:
 	rm -f icepack
diff --git a/icepll/Makefile b/icepll/Makefile
index 4efa4e1..87eabfa 100644
--- a/icepll/Makefile
+++ b/icepll/Makefile
@@ -11,10 +11,10 @@ icepll$(EXE): icepll.o
 
 install: all
 	mkdir -p $(DESTDIR)$(PREFIX)/bin
-	cp icepll $(DESTDIR)$(PREFIX)/bin/icepll
+	cp icepll$(EXE) $(DESTDIR)$(PREFIX)/bin/icepll$(EXE)
 
 uninstall:
-	rm -f $(DESTDIR)$(PREFIX)/bin/icepll
+	rm -f $(DESTDIR)$(PREFIX)/bin/icepll$(EXE)
 
 clean:
 	rm -f icepll
diff --git a/iceprog/Makefile b/iceprog/Makefile
index c61b470..d71a9b7 100644
--- a/iceprog/Makefile
+++ b/iceprog/Makefile
@@ -23,12 +23,12 @@ iceprog$(EXE): iceprog.o
 
 install: all
 	mkdir -p $(DESTDIR)$(PREFIX)/bin
-	cp iceprog $(DESTDIR)$(PREFIX)/bin/iceprog
+	cp iceprog$(EXE) $(DESTDIR)$(PREFIX)/bin/iceprog$(EXE)
 	mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1
 	install -c -m 644 iceprog.1 $(DESTDIR)$(PREFIX)/share/man/man1
 
 uninstall:
-	rm -f $(DESTDIR)$(PREFIX)/bin/iceprog
+	rm -f $(DESTDIR)$(PREFIX)/bin/iceprog$(EXE)
 	rm -f $(DESTDIR)$(PREFIX)/share/man/man1/iceprog.1
 
 clean:
diff --git a/icetime/Makefile b/icetime/Makefile
index f30a42a..5e959c7 100644
--- a/icetime/Makefile
+++ b/icetime/Makefile
@@ -19,10 +19,10 @@ timings.inc: timings.py ../icefuzz/timings_*.txt
 
 install: all
 	mkdir -p $(DESTDIR)$(PREFIX)/bin
-	cp icetime $(DESTDIR)$(PREFIX)/bin/icetime
+	cp icetime$(EXE) $(DESTDIR)$(PREFIX)/bin/icetime$(EXE)
 
 uninstall:
-	rm -f $(DESTDIR)$(PREFIX)/bin/icetime
+	rm -f $(DESTDIR)$(PREFIX)/bin/icetime$(EXE)
 
 
 # View timing netlist:
-- 
cgit v1.2.3