aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 10de910b06a8aa0bc593b204c1725cefb850dfbc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.POSIX:

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)

install: asroot
	mkdir -p -- "$(DESTDIR)$(PREFIX)/bin/"
	mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man8/"
	cp -- asroot "$(DESTDIR)$(PREFIX)/bin/asroot"
	cp -- asroot.8 "$(DESTDIR)$(MANPREFIX)/man8/asroot.8"

post-install:
	chown -- '0:wheel' "$(DESTDIR)$(PREFIX)/bin/asroot"
	chmod -- 4750 "$(DESTDIR)$(PREFIX)/bin/asroot"

uninstall:
	-rm -f -- "$(DESTDIR)$(PREFIX)/bin/asroot"
	-rm -f -- "$(DESTDIR)$(MANPREFIX)/man8/asroot.8"

clean:
	-rm -f -- asroot *.o *.su

.SUFFIXES:
.SUFFIXES: .o .c

.PHONY: all install post-install uninstall clean