diff options
author | Elvira Khabirova <lineprinter0@gmail.com> | 2017-02-12 02:50:15 +0300 |
---|---|---|
committer | Elvira Khabirova <lineprinter0@gmail.com> | 2017-02-12 16:13:03 +0300 |
commit | ea82010fbfe1e306bb3d7fbd29057c0dc5c77e48 (patch) | |
tree | 90342bc017b209e47c9cf63f36808e10365e2634 | |
parent | 40eb5c03fdc1aaa493a40252e35de9b18f6db975 (diff) | |
download | icestorm-ea82010fbfe1e306bb3d7fbd29057c0dc5c77e48.tar.gz icestorm-ea82010fbfe1e306bb3d7fbd29057c0dc5c77e48.tar.bz2 icestorm-ea82010fbfe1e306bb3d7fbd29057c0dc5c77e48.zip |
Clean up Makefiles
-rw-r--r-- | Makefile | 39 | ||||
-rw-r--r-- | config.mk | 7 | ||||
-rw-r--r-- | icebram/Makefile | 4 | ||||
-rw-r--r-- | icecompr/Makefile | 9 | ||||
-rw-r--r-- | icemulti/Makefile | 4 | ||||
-rw-r--r-- | icepack/Makefile | 4 | ||||
-rw-r--r-- | icepll/Makefile | 4 | ||||
-rw-r--r-- | iceprog/Makefile | 2 | ||||
-rw-r--r-- | icetime/Makefile | 4 |
9 files changed, 21 insertions, 56 deletions
@@ -1,40 +1,11 @@ include config.mk -all: - $(MAKE) -C icebox - $(MAKE) -C icepack - $(MAKE) -C iceprog - $(MAKE) -C icemulti - $(MAKE) -C icepll - $(MAKE) -C icetime - $(MAKE) -C icebram +SUBDIRS = icebox icepack iceprog icemulti icepll icetime icebram -clean: - $(MAKE) -C icebox clean - $(MAKE) -C icepack clean - $(MAKE) -C iceprog clean - $(MAKE) -C icemulti clean - $(MAKE) -C icepll clean - $(MAKE) -C icetime clean - $(MAKE) -C icebram clean - -install: - $(MAKE) -C icebox install - $(MAKE) -C icepack install - $(MAKE) -C iceprog install - $(MAKE) -C icemulti install - $(MAKE) -C icepll install - $(MAKE) -C icetime install - $(MAKE) -C icebram install - -uninstall: - $(MAKE) -C icebox uninstall - $(MAKE) -C icepack uninstall - $(MAKE) -C iceprog uninstall - $(MAKE) -C icemulti uninstall - $(MAKE) -C icepll uninstall - $(MAKE) -C icetime uninstall - $(MAKE) -C icebram uninstall +all clean install uninstall: + for dir in $(SUBDIRS); do \ + $(MAKE) -C $$dir $@ || exit; \ + done mxebin: clean $(MAKE) MXE=1 @@ -1,5 +1,8 @@ -CXX ?= clang -CC ?= $(CXX) +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 PKG_CONFIG ?= pkg-config DESTDIR ?= PREFIX ?= /usr/local diff --git a/icebram/Makefile b/icebram/Makefile index 827fe7c..d16b80b 100644 --- a/icebram/Makefile +++ b/icebram/Makefile @@ -1,6 +1,4 @@ include ../config.mk -LDLIBS = -lm -lstdc++ -CXXFLAGS = -MD -O0 -ggdb -Wall -std=c++11 -I/usr/local/include ifeq ($(STATIC),1) LDFLAGS += -static @@ -9,7 +7,7 @@ endif all: icebram$(EXE) icebram$(EXE): icebram.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) + $(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS) test: icebram bash rundemo.sh diff --git a/icecompr/Makefile b/icecompr/Makefile index b230ffa..1c443f0 100644 --- a/icecompr/Makefile +++ b/icecompr/Makefile @@ -1,13 +1,14 @@ +include ../config.mk all: icecompr iceuncompr test: example_1k.ok example_8k.ok -icecompr: icecompr.cc - clang++ -o icecompr -Wall -Wextra -std=c++11 icecompr.cc +icecompr: icecompr.o + $(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS) -iceuncompr: iceuncompr.c - clang -o iceuncompr -Wall -Wextra iceuncompr.c +iceuncompr: iceuncompr.o + $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) %.compr: %.bin icecompr ./icecompr -v $< $@ diff --git a/icemulti/Makefile b/icemulti/Makefile index 009889e..a168bac 100644 --- a/icemulti/Makefile +++ b/icemulti/Makefile @@ -1,6 +1,4 @@ include ../config.mk -LDLIBS = -lm -lstdc++ -CXXFLAGS = -MD -O0 -ggdb -Wall -std=c++11 ifeq ($(STATIC),1) LDFLAGS += -static @@ -9,7 +7,7 @@ endif all: icemulti$(EXE) icemulti$(EXE): icemulti.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) + $(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS) install: all mkdir -p $(DESTDIR)$(PREFIX)/bin diff --git a/icepack/Makefile b/icepack/Makefile index cfe48be..2578fe0 100644 --- a/icepack/Makefile +++ b/icepack/Makefile @@ -1,6 +1,4 @@ include ../config.mk -LDLIBS = -lm -lstdc++ -CXXFLAGS = -MD -O0 -ggdb -Wall -std=c++11 -I/usr/local/include MXEGCC = /usr/local/src/mxe/usr/bin/i686-pc-mingw32-gcc ifeq ($(STATIC),1) @@ -10,7 +8,7 @@ endif all: icepack$(EXE) iceunpack$(EXE) icepack$(EXE): icepack.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) + $(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS) iceunpack: icepack ln -sf icepack iceunpack diff --git a/icepll/Makefile b/icepll/Makefile index e0badf6..4efa4e1 100644 --- a/icepll/Makefile +++ b/icepll/Makefile @@ -1,6 +1,4 @@ include ../config.mk -LDLIBS = -lm -lstdc++ -CXXFLAGS = -MD -O0 -ggdb -Wall -std=c++11 -I/usr/local/include ifeq ($(STATIC),1) LDFLAGS += -static @@ -9,7 +7,7 @@ endif all: icepll$(EXE) icepll$(EXE): icepll.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) + $(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS) install: all mkdir -p $(DESTDIR)$(PREFIX)/bin diff --git a/iceprog/Makefile b/iceprog/Makefile index 5614646..286460f 100644 --- a/iceprog/Makefile +++ b/iceprog/Makefile @@ -2,11 +2,9 @@ include ../config.mk ifneq ($(shell uname -s),Darwin) LDLIBS = -L/usr/local/lib -lm - CFLAGS = -MD -O0 -ggdb -Wall -std=c99 -I/usr/local/include else LIBFTDI_NAME = $(shell $(PKG_CONFIG) --exists libftdi1 && echo ftdi1 || echo ftdi) LDLIBS = -L/usr/local/lib -l$(LIBFTDI_NAME) -lm - CFLAGS = -MD -O0 -ggdb -Wall -std=c99 -I/usr/local/include endif ifeq ($(STATIC),1) diff --git a/icetime/Makefile b/icetime/Makefile index cfa7ff0..f30a42a 100644 --- a/icetime/Makefile +++ b/icetime/Makefile @@ -1,6 +1,6 @@ include ../config.mk LDLIBS = -lm -lstdc++ -CXXFLAGS = -MD -O0 -ggdb -Wall -std=c++11 -I/usr/local/include -DPREFIX='"$(PREFIX)"' -DCHIPDB_SUBDIR='"$(CHIPDB_SUBDIR)"' +override CXXFLAGS += -DPREFIX='"$(PREFIX)"' -DCHIPDB_SUBDIR='"$(CHIPDB_SUBDIR)"' ifeq ($(STATIC),1) LDFLAGS += -static @@ -9,7 +9,7 @@ endif all: icetime$(EXE) icetime$(EXE): icetime.o - $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) + $(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS) icetime.o: icetime.cc timings.inc |