ref: c2d4cf249f3e60d34dc32d4664936883741d98ba
parent: 3fb3ff2c0b27f8468e1e1ad24465742d3b89dc4e
author: Quentin Rameau <[email protected]>
date: Tue Jan 24 13:45:01 EST 2017
[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.
--- a/Makefile
+++ b/Makefile
@@ -12,11 +12,11 @@
$(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; \
@@ -25,9 +25,6 @@
ln -f cc1/cc1-$@ bin/
ln -f cc2/cc2-$@ bin/
-bin:
- mkdir -p bin
-
tests: all
cd tests/execute && $(MAKE) -e tests
@@ -36,18 +33,17 @@
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); \
@@ -63,5 +59,4 @@
rm -f bin/cc* bin/scc
distclean: clean
- rm -rf bin
rm -f inc/sysincludes.h
--- /dev/null
+++ b/bin/cpp.sh
@@ -1,0 +1,2 @@
+#!/bin/sh
+scc -E $@