dtms
view Makefile @ 4:db4bb4b5905a
security fixes:
- refuse to run as root
- drop privileges without an explicit -u argument when running setuid-root
fixed argument parsing
fixed mem leak
added install and uninstall rules (Makefile)
author | Eleni Maria Stea <eleni@mutantstargoat.com> |
---|---|
date | Sun, 15 May 2016 00:15:45 +0300 |
parents | 50af08b83a1f |
children |
line source
1 # change the following line to install to a different prefix
2 PREFIX = /usr/local
4 src = $(wildcard src/*.c)
5 obj = $(src:.c=.o)
6 dep = $(obj:.o=.d)
7 bin = dtms
9 dbg = -g
10 opt = -O0
12 CFLAGS = -pedantic -Wall -std=gnu99 -DPREFIX=\"$(PREFIX)\" $(dbg)
14 $(bin): $(obj)
15 $(CC) -o $@ $(obj) $(LDFLAGS)
17 -include $(dep)
19 %.d: %.c
20 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
22 .PHONY: clean
23 clean:
24 rm -f $(obj) $(bin) $(dep)
26 .PHONY: install
27 install: $(bin)
28 mkdir -p $(PREFIX)/bin $(PREFIX)/share/dtms
29 cp $(bin) $(PREFIX)/bin/$(bin)
30 chown root $(PREFIX)/bin/$(bin)
31 chmod +s $(PREFIX)/bin/$(bin)
32 cp data/dtms.mp3 $(PREFIX)/share/dtms/dtms.mp3
34 .PHONY: uninstall
35 uninstall:
36 rm -f $(PREFIX)/bin/$(bin)
37 rm -f $(PREFIX)/share/dtms/dtms.mp3
38 rmdir $(PREFIX)/share/dtms