[hackers] [scc] Make Makefiles even more user friendly || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Mon, 25 Jan 2016 12:46:05 +0100 (CET)

commit b5a123a0a108eef52d9e7df25e63707a55a32b99
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Mon Jan 25 12:08:58 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Mon Jan 25 12:08:58 2016 +0100

    Make Makefiles even more user friendly
    
    This commit uses a more clean name for scc flags,
    and combine them with use flags, which simplifies
    all the other rules in the project.

diff --git a/cc1/Makefile b/cc1/Makefile
index 9cde066..6f97bf8 100644
--- a/cc1/Makefile
+++ b/cc1/Makefile
_AT_@ -10,7 +10,7 @@ all: cc1
 $(OBJS) : cc1.h ../inc/cc.h ../inc/sizes.h arch/$(ARCH)/arch.h
 
 cc1: $(OBJS) ../lib/libcc.a
- $(CC) $(SLDFLAGS) $(LDFLAGS) $(OBJS) ../lib/libcc.a -o $_AT_
+ $(CC) $(SCC_LDFLAGS) $(OBJS) ../lib/libcc.a -o $_AT_
 
 cpp: cc1
         ln -f cc1 cpp
diff --git a/cc2/Makefile b/cc2/Makefile
index febe44c..79666d0 100644
--- a/cc2/Makefile
+++ b/cc2/Makefile
_AT_@ -16,7 +16,7 @@ error.h: cc2.h
         awk -f generror cc2.h > $$$$.h && mv $$$$.h $_AT_
 
 cc2: $(OBJS) ../lib/libcc.a
- $(CC) $(SLDFLAGS) $(LDFLAGS) $(OBJS) ../lib/libcc.a -o $_AT_
+ $(CC) $(SCC_LDFLAGS) $(OBJS) ../lib/libcc.a -o $_AT_
 
 clean:
         rm -f $(OBJS)
diff --git a/config.mk b/config.mk
index 7542bdd..4101c80 100644
--- a/config.mk
+++ b/config.mk
_AT_@ -14,11 +14,11 @@ MANPREFIX = ${PREFIX}/share/man
 # AR = ar
 
 # for Plan9 add -D_SUSV2_SOURCE -DNBOOL
-SCFLAGS = -DNDEBUG -Iarch/$(ARCH) -DPREFIX=\""$(PREFIX)"\"
-SLDFLAGS =
+SCC_CFLAGS = -DNDEBUG -Iarch/$(ARCH) -DPREFIX=\""$(PREFIX)"\" $(CFLAGS)
+SCC_LDFLAGS = $(LDFLAGS)
 
 .c.o:
- $(CC) $(SCFLAGS) $(CFLAGS) -o $_AT_ -c $<
+ $(CC) $(SCC_CFLAGS) -o $_AT_ -c $<
 
 .c:
- $(CC) $(SCFLAGS) $(CFLAGS) -o $_AT_ $<
+ $(CC) $(SCC_CFLAGS) $(SCC_LDFLAGS) -o $_AT_ $<
Received on Mon Jan 25 2016 - 12:46:05 CET

This archive was generated by hypermail 2.3.0 : Mon Jan 25 2016 - 12:48:23 CET