mirror of
git://git.suckless.org/sbase
synced 2024-12-22 07:01:15 +00:00
build: Posixfy the Makefile
This commit is contained in:
parent
ddde8021b3
commit
090490b81d
12
Makefile
12
Makefile
@ -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) $@ $?
|
||||
|
11
config.mk
11
config.mk
@ -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 =
|
||||
|
Loading…
Reference in New Issue
Block a user