-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (36 loc) · 1.03 KB
/
Makefile
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
37
38
39
40
41
42
43
44
45
# Define USE_WRAP if you want to compile with
# libwrap (hosts.{allow,deny} access control)
ifneq ($(USE_WRAP),)
LIBS += -lwrap
DEFINES += -DUSE_LIBWRAP
endif
# If you don't have it in /var/log/subsys, uncomment and define
#CFLAGS += -DLOCKFILE_DIR=\"/var/log\"
# GNU target string
CROSS =
CC = $(CROSS)gcc
STRIP = $(CROSS)strip
CFLAGS += -O2 -Wall
PROG = p910nd
CONFIG = p910nd.conf
INITSCRIPT = p910nd.init
MANPAGE = p910nd.8
INSTALL = install
BINDIR = /usr/sbin
CONFIGDIR = /etc/sysconfig
SCRIPTDIR = /etc/init.d
MANDIR = /usr/share/man/man8
$(PROG): p910nd.c
$(CC) -o $@ $^ $(CFLAGS) $(DEFINES) $(LIBS)
strip: $(PROG)
$(STRIP) -s $(PROG)
install: $(PROG) $(CONFIG) $(INITSCRIPT) $(MANPAGE)
mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(CONFIGDIR) \
$(DESTDIR)$(SCRIPTDIR) $(DESTDIR)$(MANDIR)
$(INSTALL) $(PROG) $(DESTDIR)$(BINDIR)
$(INSTALL) -m 644 $(CONFIG) $(DESTDIR)$(CONFIGDIR)/$(PROG)
$(INSTALL) $(INITSCRIPT) $(DESTDIR)$(SCRIPTDIR)/$(PROG)
$(INSTALL) -m 644 $(MANPAGE) $(DESTDIR)$(MANDIR)
.PHONY: clean
clean:
rm -f *.o $(PROG)