scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 8dbadd934ddb9e65469784fba51b819085edafb5
parent b1ab56147455451330f284bf37d227cd42e97715
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 29 Nov 2016 13:36:17 +0100

Remove multi targets in Makefile

This way of building was crappy because it had to clean
all the files in every step, and it was very easy to merge
files from different architectures. After the last changes
the common objects are totally independent of the architecture
so they can be used without problems.

The default target build all the architectures instead of building
only the one controlled by the ARCH variable.

Diffstat:
MMakefile | 23+++++++----------------
1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/Makefile b/Makefile @@ -8,15 +8,6 @@ DIRS = lib cc1 cc2 driver/$(DRIVER) ARCHS = z80 i386-sysv amd64-sysv qbe all: - for i in $(DIRS); \ - do \ - (cd $$i && $(MAKE) -e); \ - done - cp -f cc1/cc1 bin/cc1 - cp -f cc2/cc2 bin/cc2 - cp -f driver/$(DRIVER)/scc bin/scc - -multi: for i in $(ARCHS); \ do \ $(MAKE) $$i || exit; \ @@ -26,7 +17,6 @@ $(ARCHS): for i in cc1 cc2; \ do \ (cd $$i; \ - ARCH=$@ $(MAKE) -e clean; \ ARCH=$@ $(MAKE) -e $$i || exit); \ done ln -f cc1/cc1 bin/cc1-$@ @@ -49,18 +39,19 @@ uninstall: rm -f $(PREFIX)/bin/scc rm -f $(PREFIX)/bin/cpp -clean: +clean-helper: for i in $(DIRS); \ do \ - (cd $$i && $(MAKE) $@ || exit); \ + (cd $$i && $(MAKE) clean || exit); \ done -multi-clean: +clean: for i in $(ARCHS); \ do \ - ARCH=$$i $(MAKE) -e clean || exit; \ + ARCH=$$i $(MAKE) -e clean-helper || exit; \ done - -distclean: multi-clean rm -f bin/cc* bin/scc + +distclean: clean + rm -rf bin rm inc/sizes.h