1
0
mirror of git://git.suckless.org/sbase synced 2024-12-21 22:50:16 +00:00

build: Posixfy the Makefile

This commit is contained in:
Roberto E. Vargas Caballero 2023-09-27 09:46:39 +02:00
parent ddde8021b3
commit 090490b81d
2 changed files with 15 additions and 8 deletions

View File

@ -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\
@ -189,13 +197,13 @@ all: $(BIN)
$(BIN): $(LIB)
$(OBJ): $(HDR) config.mk
$(OBJ): $(HDR)
.o:
$(CC) $(LDFLAGS) -o $@ $< $(LIB)
.c.o:
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
libutf.a: $(LIBUTFOBJ)
$(AR) $(ARFLAGS) $@ $?

View File

@ -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 =