[hackers] [scc] [crt] Add crt to (un)install target || Quentin Rameau

From: <git_AT_suckless.org>
Date: Fri, 24 Mar 2017 10:34:25 +0100 (CET)

commit 18558d023079b549c0454228feab70a6e27c67f0
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Wed Mar 22 09:59:02 2017 +0100
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Thu Mar 23 16:24:36 2017 +0100

    [crt] Add crt to (un)install target

diff --git a/Makefile b/Makefile
index 6434f50..da035c3 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -4,7 +4,7 @@
 
 include config.mk
 
-DIRS = lib cc1 cc2 driver/$(DRIVER) libc/src
+DIRS = lib cc1 cc2 crt driver/$(DRIVER) libc/src
 
 all: scc-driver
         for i in $(ARCHS); \
_AT_@ -17,13 +17,19 @@ scc-driver:
         ln -f driver/$(DRIVER)/scc bin/scc
 
 $(ARCHS):
- pwd=$$PWD ;\
+ pwd=$$PWD; \
         for i in cc1 cc2; \
         do \
                 cd $$i; \
                 ARCH=$_AT_ $(MAKE) -e $$i-$@ || exit; \
- cd $$pwd ;\
+ cd $$pwd; \
         done
+ cd crt; \
+ for i in $(SYSS); \
+ do \
+ ARCH=$_AT_ SYS=$$i $(MAKE) -e || exit; \
+ done; \
+ cd $$pwd;
         ln -f cc1/cc1-$_AT_ bin/
         ln -f cc2/cc2-$_AT_ bin/
 
_AT_@ -39,9 +45,11 @@ install: all
         mkdir -p $(DESTDIR)/$(PREFIX)/libexec/scc/
         mkdir -p $(DESTDIR)/$(PREFIX)/bin/
         mkdir -p $(DESTDIR)/$(PREFIX)/include/scc/
+ mkdir -p $(DESTDIR)/$(PREFIX)/lib/scc/
         cp -f bin/cc?-* $(DESTDIR)/$(PREFIX)/libexec/scc/
         cp -f bin/cpp.sh $(DESTDIR)/$(PREFIX)/bin/scpp
         cp -f bin/scc $(DESTDIR)/$(PREFIX)/bin/
+ cp -f crt/crt-*.o $(DESTDIR)/$(PREFIX)/lib/scc/
         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*
_AT_@ -50,6 +58,7 @@ install: all
 uninstall:
         rm -rf $(DESTDIR)/$(PREFIX)/include/scc/
         rm -rf $(DESTDIR)/$(PREFIX)/libexec/scc/
+ rm -rf $(DESTDIR)/$(PREFIX)/lib/scc/
         rm -f $(DESTDIR)/$(PREFIX)/bin/scc
         rm -f $(DESTDIR)/$(PREFIX)/bin/scpp
 
diff --git a/config.mk b/config.mk
index 1c015b2..3b3a1f0 100644
--- a/config.mk
+++ b/config.mk
_AT_@ -3,6 +3,7 @@ VERSION = 0.1
 
 ## Customize below to fit your system
 ARCHS = z80 i386-sysv amd64-sysv qbe
+SYSS = linux openbsd
 # default architecure used in nested makefiles
 ARCH = qbe
 SYS = linux
diff --git a/crt/Makefile b/crt/Makefile
new file mode 100644
index 0000000..5b35abb
--- /dev/null
+++ b/crt/Makefile
_AT_@ -0,0 +1,11 @@
+.POSIX:
+
+include ../config.mk
+
+all: crt-$(ARCH)-$(SYS).o
+
+crt-$(ARCH)-$(SYS).o: $(ARCH)-$(SYS)/crt.o
+ ln -f $(ARCH)-$(SYS)/crt.o $_AT_
+
+clean:
+ rm -f */crt.o crt-*.o
Received on Fri Mar 24 2017 - 10:34:25 CET

This archive was generated by hypermail 2.3.0 : Fri Mar 24 2017 - 10:36:21 CET