playground

Sandbox, container or whatever utilities for linux.
git clone https://pi.duncano.de/git/playground.git
Log | Files | Refs | README

commit e3c282d672c0165940c71cde03b27b52aec392fa
parent f803dcee366b2b0120a7ae065da5b6d3fd2ad669
Author: Duncaen <mail@duncano.de>
Date:   Sun, 19 Feb 2017 19:32:21 +0100

Makefile: move variables to config.mk

Diffstat:
Makefile | 24++++++++++--------------
config.mk | 11+++++++++++
2 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,20 +1,11 @@ .error : This Makefile needs GNU make -CFLAGS+=-std=c99 -g -O2 -fstack-protector-strong -Iinclude -CFLAGS+=-Wall -Wextra -Wwrite-strings -Wno-switch -Wno-extended-offsetof -pedantic -CPPFLAGS+=-D_DEFAULT_SOURCE -D_FORTIFY_SOURCE=2 - -DESTDIR= -PREFIX=/usr/local -BINDIR=$(PREFIX)/bin -LIBDIR=$(PREFIX)/lib -INCDIR=$(PREFIX)/include -MANDIR=$(PREFIX)/share/man +include config.mk PROGS = pledge # newns LIBS = libpledge # libnewns ALL = $(LIBS:=.a) $(LIBS:=.so) $(PROGS) -all: $(ALL) +all: options $(ALL) $(PROGS) : % : %.o $(LIBS:=.a) : %.a : %.o @@ -29,14 +20,19 @@ pledge: libpledge.a pledge: $(CC) $^ -o $@ $(LDFLAGS) -ns: - $(CC) $^ -o $@ $(LDFLAGS) +# newns: +# $(CC) $^ -o $@ $(LDFLAGS) %.a: ar rc $@ $^ %.so: +options: + @echo "CFLAGS = ${CFLAGS}" + @echo "LDFLAGS = ${LDFLAGS}" + @echo "CC = ${CC}" + clean: -rm -f $(ALL) *.o @@ -51,4 +47,4 @@ install: all # install -m0644 libnewns.a libnewns.so $(DESTDIR)$(LIBDIR) # install -m0644 newns.h $(DESTDIR)$(INCDIR) -.PHONY: all clean install +.PHONY: all options clean install diff --git a/config.mk b/config.mk @@ -0,0 +1,11 @@ +PREFIX=/usr/local +BINDIR=$(PREFIX)/bin +LIBDIR=$(PREFIX)/lib +INCDIR=$(PREFIX)/include +MANDIR=$(PREFIX)/share/man + +CFLAGS+=-std=c99 -g -O2 -fstack-protector-strong -Iinclude +CFLAGS+=-Wall -Wextra -Wwrite-strings -Wno-switch -Wno-extended-offsetof -pedantic +CPPFLAGS+=-D_DEFAULT_SOURCE -D_FORTIFY_SOURCE=2 + +CC=cc