[hackers] [scc] Remove multi targets in Makefile || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Tue, 29 Nov 2016 13:42:25 +0100 (CET)

commit 8dbadd934ddb9e65469784fba51b819085edafb5
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Tue Nov 29 13:36:17 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Tue Nov 29 13:36:17 2016 +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.

diff --git a/Makefile b/Makefile
index bf0ac54..d867c22 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -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; \
_AT_@ -26,7 +17,6 @@ $(ARCHS):
         for i in cc1 cc2; \
         do \
                 (cd $$i; \
- ARCH=$_AT_ $(MAKE) -e clean; \
                 ARCH=$_AT_ $(MAKE) -e $$i || exit); \
         done
         ln -f cc1/cc1 bin/cc1-$_AT_
_AT_@ -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) $_AT_ || 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
Received on Tue Nov 29 2016 - 13:42:25 CET

This archive was generated by hypermail 2.3.0 : Tue Nov 29 2016 - 13:48:19 CET