aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile9
-rw-r--r--config.mk4
2 files changed, 11 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index ae36177..10de910 100644
--- a/Makefile
+++ b/Makefile
@@ -3,9 +3,13 @@
CONFIGFILE = config.mk
include $(CONFIGFILE)
+
all: asroot
asroot.o: asroot.c arg.h
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
+
asroot: asroot.o
$(CC) -o $@ asroot.o $(LDFLAGS)
@@ -24,6 +28,9 @@ uninstall:
-rm -f -- "$(DESTDIR)$(MANPREFIX)/man8/asroot.8"
clean:
- -rm -f -- asroot.o asroot
+ -rm -f -- asroot *.o *.su
+
+.SUFFIXES:
+.SUFFIXES: .o .c
.PHONY: all install post-install uninstall clean
diff --git a/config.mk b/config.mk
index 90c3672..dafaf0a 100644
--- a/config.mk
+++ b/config.mk
@@ -1,8 +1,10 @@
PREFIX = /usr
MANPREFIX = $(PREFIX)/share/man
+CC = cc
+
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_GNU_SOURCE
-CFLAGS = -std=c99 -Wall -O2 $(CPPFLAGS)
+CFLAGS = -std=c99 -Wall -O2
LDFLAGS = -s -lcrypt