[hackers] [scc] [cpp] use a shell script instead of cc1 binary || Quentin Rameau

From: <git_AT_suckless.org>
Date: Tue, 24 Jan 2017 18:49:19 +0100 (CET)

commit 8bd13ada5c51bfa776c719ccc23b5a5b8f64f2e2
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Tue Jan 24 18:45:01 2017 +0100
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Tue Jan 24 18:48:56 2017 +0100

    [cpp] use a shell script instead of cc1 binary
    
    By using cpp as scc -E via a shell script, we don't have to worry about
    default ARCH and can even select it at runtime.

diff --git a/Makefile b/Makefile
index 1b39f78..970c578 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -12,11 +12,11 @@ all: driver/$(DRIVER)/scc
                 $(MAKE) $$i || exit; \
         done
 
-driver/$(DRIVER)/scc: bin
+driver/$(DRIVER)/scc:
         cd driver/$(DRIVER)/ && $(MAKE) scc
         ln -f driver/$(DRIVER)/scc bin/scc
 
-$(ARCHS): bin
+$(ARCHS):
         for i in cc1 cc2; \
         do \
                 (cd $$i; \
_AT_@ -25,9 +25,6 @@ $(ARCHS): bin
         ln -f cc1/cc1-$_AT_ bin/
         ln -f cc2/cc2-$_AT_ bin/
 
-bin:
- mkdir -p bin
-
 tests: all
         cd tests/execute && $(MAKE) -e tests
 
_AT_@ -36,18 +33,17 @@ install: all
         mkdir -p $(DESTDIR)/$(PREFIX)/bin/
         mkdir -p $(DESTDIR)/$(PREFIX)/include/scc/
         cp -f bin/cc?-* $(DESTDIR)/$(PREFIX)/libexec/scc/
- cp -f bin/cc1-$(ARCH) $(DESTDIR)/$(PREFIX)/bin/cpp
+ cp -f bin/cpp.sh $(DESTDIR)/$(PREFIX)/bin/cpp
         cp -f bin/scc $(DESTDIR)/$(PREFIX)/bin/
         cp -fr libc/include/* $(DESTDIR)/$(PREFIX)/include/scc/
         find $(DESTDIR)/$(PREFIX)/include/scc/ -type f | xargs chmod 644
         cd $(DESTDIR)/$(PREFIX)/libexec/scc/ && chmod 755 cc* && strip cc*
- cd $(DESTDIR)/$(PREFIX)/bin && chmod 755 cpp scc && strip cpp scc
+ cd $(DESTDIR)/$(PREFIX)/bin && chmod 755 cpp scc && strip scc
 
 uninstall:
         rm -rf $(DESTDIR)/$(PREFIX)/include/scc/
         rm -rf $(DESTDIR)/$(PREFIX)/libexec/scc/
         rm -f $(DESTDIR)/$(PREFIX)/bin/scc
- rm -f $(DESTDIR)/$(PREFIX)/bin/cpp
 
 clean-helper:
         for i in $(DIRS); \
_AT_@ -63,5 +59,4 @@ clean:
         rm -f bin/cc* bin/scc
 
 distclean: clean
- rm -rf bin
         rm -f inc/sysincludes.h
diff --git a/bin/cpp.sh b/bin/cpp.sh
new file mode 100644
index 0000000..2ea0cce
--- /dev/null
+++ b/bin/cpp.sh
_AT_@ -0,0 +1,2 @@
+#!/bin/sh
+scc -E $_AT_
Received on Tue Jan 24 2017 - 18:49:19 CET

This archive was generated by hypermail 2.3.0 : Tue Jan 24 2017 - 19:00:24 CET