[hackers] [sbase] build: Posixfy the Makefile || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Fri, 20 Oct 2023 14:53:23 +0200 (CEST)

commit 090490b81d01f4e1da005560669fbb1239c88989
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Wed Sep 27 09:46:39 2023 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Wed Sep 27 09:46:39 2023 +0200

    build: Posixfy the Makefile

diff --git a/Makefile b/Makefile
index bd2e5b1..8da0106 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -1,8 +1,16 @@
+.POSIX:
 include config.mk
 
 .SUFFIXES:
 .SUFFIXES: .o .c
 
+CPPFLAGS =\
+ -D_DEFAULT_SOURCE \
+ -D_NETBSD_SOURCE \
+ -D_BSD_SOURCE \
+ -D_XOPEN_SOURCE=700 \
+ -D_FILE_OFFSET_BITS=64
+
 HDR =\
         arg.h\
         compat.h\
_AT_@ -189,13 +197,13 @@ all: $(BIN)
 
 $(BIN): $(LIB)
 
-$(OBJ): $(HDR) config.mk
+$(OBJ): $(HDR)
 
 .o:
         $(CC) $(LDFLAGS) -o $_AT_ $< $(LIB)
 
 .c.o:
- $(CC) $(CFLAGS) $(CPPFLAGS) -o $_AT_ -c $<
+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $_AT_ -c $<
 
 libutf.a: $(LIBUTFOBJ)
         $(AR) $(ARFLAGS) $_AT_ $?
diff --git a/config.mk b/config.mk
index 9fb18da..9d82b04 100644
--- a/config.mk
+++ b/config.mk
_AT_@ -5,12 +5,11 @@ VERSION = 0.0
 PREFIX = /usr/local
 MANPREFIX = $(PREFIX)/share/man
 
-CC = cc
-AR = ar
+# tools
+#CC =
+#AR =
 RANLIB = ranlib
 
-# for NetBSD add -D_NETBSD_SOURCE
 # -lrt might be needed on some systems
-CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_FILE_OFFSET_BITS=64
-CFLAGS = -std=c99 -Wall -pedantic
-LDFLAGS = -s
+# CFLAGS =
+# LDFLAGS =
Received on Fri Oct 20 2023 - 14:53:23 CEST

This archive was generated by hypermail 2.3.0 : Fri Oct 20 2023 - 15:00:35 CEST