shithub: scc

Download patch

ref: 235b5368a2c5ad4d58fb02dc9efa0a8d59fb3830
parent: a0c41efbdb9763d954d3733021ef356c35c05ed6
author: Roberto E. Vargas Caballero <[email protected]>
date: Sun Jul 19 15:32:50 EDT 2015

Update to suckless Makefile style

--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,20 @@
+# scc - Sucless C Compiler
 
-DIRS = lib cc1 cc2
+include config.mk
 
+SUBDIRS  = \
+	lib \
+	cc1 \
+	cc2
+
 all clean:
-	for i in $(DIRS) ;\
+	@echo scc build options:
+	@echo "CFLAGS   = ${CFLAGS}"
+	@echo "LDFLAGS  = ${LDFLAGS}"
+	@echo "CC       = ${CC}"
+	@for i in ${SUBDIRS};\
 	do \
-		(cd $$i && $(MAKE) $@) ;\
-	done
+		(cd $$i; ${MAKE} $(MAKEFLAGS) $@ || exit); \
+	done;
 
 .POSIX:
--- /dev/null
+++ b/config.mk
@@ -1,0 +1,15 @@
+# Customize to fit your system
+
+# paths
+PREFIX      = /usr/local/
+MANPREFIX   = ${PREFIX}/share/man
+
+VERSION     = 0.1
+
+# Flags
+#CFLAGS      = -std=c99
+#LDFLAGS     =
+
+# Tools
+#CC          = cc
+#AR          =