[hackers] [scc] Add support for multi arch in the main Makefile || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Sat, 23 Jan 2016 21:35:59 +0100 (CET)

commit 517dc5a89fc3274dd6457b32653616e355369717
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Sat Jan 23 21:31:12 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Sat Jan 23 21:35:40 2016 +0100

    Add support for multi arch in the main Makefile

diff --git a/Makefile b/Makefile
index af19d87..bd42eb1 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -3,18 +3,34 @@
 
 include config.mk
 
-SUBDIRS = \
- lib \
- cc1 \
- cc2
+SUBDIRS = lib cc1 cc2
+
+ARCHS = z80 i386-sysv amd64-sysv
 
 all clean:
- _AT_echo scc build options:
- _AT_echo "CFLAGS = ${CFLAGS}"
- _AT_echo "LDFLAGS = ${LDFLAGS}"
- _AT_echo "CC = ${CC}"
- _AT_for i in ${SUBDIRS};\
+ for i in ${SUBDIRS};\
         do \
- (cd $$i; ${MAKE} $(MAKEFLAGS) $_AT_ || exit); \
- done;
+ (cd $$i; ${MAKE} -$(MAKEFLAGS) $_AT_ || exit); \
+ done
+
+multi: $(ARCHS)
+
+lib/libcc.a:
+ cd lib && $(MAKE) -$(MAKEFLAGS) all
+
+$(ARCHS): lib/libcc.a
+ for i in cc1 cc2; \
+ do \
+ (cd $$i; ARCH=$_AT_ ${MAKE} -e $(MAKEFLAGS) clean $$i || exit); \
+ done
+ ln -f cc1/cc1 bin/cc1-$_AT_
+ ln -f cc2/cc2 bin/cc2-$_AT_
+
+install:
+ mkdir -p $(DESTDIR)$(PREFIX)/libexec/scc/
+ cp -f bin/cc[12]-*
+ cd $(DESTDIR)$(PREFIX)/libexec/scc/ && chmod 755 cc[12]-*
+
 
+distclean: clean
+ rm -f bin/cc[12]-*
diff --git a/bin/README b/bin/README
new file mode 100644
index 0000000..2169a3a
--- /dev/null
+++ b/bin/README
_AT_@ -0,0 +1 @@
+This is place holder for control version systems
diff --git a/cc1/arch/amd64-sysv/arch.h b/cc1/arch/amd64-sysv/arch.h
new file mode 100644
index 0000000..82d6e9b
--- /dev/null
+++ b/cc1/arch/amd64-sysv/arch.h
_AT_@ -0,0 +1,33 @@
+
+#define RANK_BOOL 0
+#define RANK_SCHAR 1
+#define RANK_UCHAR 1
+#define RANK_CHAR 1
+#define RANK_SHORT 2
+#define RANK_USHORT 2
+#define RANK_INT 3
+#define RANK_UINT 3
+#define RANK_LONG 4
+#define RANK_ULONG 4
+#define RANK_LLONG 5
+#define RANK_ULLONG 5
+#define RANK_FLOAT 6
+#define RANK_DOUBLE 7
+#define RANK_LDOUBLE 8
+
+#define TINT long long
+#define TUINT unsigned long long
+#define TFLOAT double
+
+#define L_SCHAR L_INT8
+#define L_UCHAR L_UINT8
+#define L_CHAR L_INT8
+#define L_SHORT L_INT16
+#define L_USHORT L_UINT16
+#define L_INT L_INT32
+#define L_UINT L_UINT32
+#define L_LONG L_INT32
+#define L_ULONG L_UINT32
+#define L_LLONG L_INT64
+#define L_ULLONG L_UINT64
+#define L_ENUM L_INT
diff --git a/cc2/arch/amd64-sysv/cgen.c b/cc2/arch/amd64-sysv/cgen.c
new file mode 100644
index 0000000..6b96df7
--- /dev/null
+++ b/cc2/arch/amd64-sysv/cgen.c
_AT_@ -0,0 +1,13 @@
+
+#include "arch.h"
+#include "../../cc2.h"
+
+void
+generate(void)
+{
+}
+
+void
+addable(void)
+{
+}
diff --git a/cc2/arch/amd64-sysv/code.c b/cc2/arch/amd64-sysv/code.c
new file mode 100644
index 0000000..2159457
--- /dev/null
+++ b/cc2/arch/amd64-sysv/code.c
_AT_@ -0,0 +1,13 @@
+
+#include "arch.h"
+#include "../../cc2.h"
+
+void
+emit(Node *np)
+{
+}
+
+void
+writeout(void)
+{
+}
diff --git a/cc2/arch/i386-sysv/cgen.c b/cc2/arch/i386-sysv/cgen.c
new file mode 100644
index 0000000..6b96df7
--- /dev/null
+++ b/cc2/arch/i386-sysv/cgen.c
_AT_@ -0,0 +1,13 @@
+
+#include "arch.h"
+#include "../../cc2.h"
+
+void
+generate(void)
+{
+}
+
+void
+addable(void)
+{
+}
Received on Sat Jan 23 2016 - 21:35:59 CET

This archive was generated by hypermail 2.3.0 : Sat Jan 23 2016 - 21:36:44 CET