-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile.in
95 lines (73 loc) · 2.55 KB
/
Makefile.in
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
include Makefile.inc
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
all: $(PROGNAME) default.conf docsd
wrap: myadns
SRCS=getopts.c readconf.c ext/cidr.c ext/fread.c ext/xmalloc.c ext/hash.c @EXTRA_SRCS@ ext/standard_dns.c main.c misc.c ext/chtbl.c
HDRS=$(SRCS:.c=.h) settings.h
OBJS=$(SRCS:.c=.o)
$(OBJS): $(HDRS) Makefile
WORDLISTS=dict_words.gz dos.gz etc-hosts.gz fast.gz jargon.gz mit.edu.gz movie-characters.gz names.gz oz.gz
DEFWL=fast.gz
docsd:
$(USE_MAKE) -C docs
$(PROGNAME): $(HDRS) Makefile $(OBJS)
echo $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(PROGNAME) $(OBJS) $(LIBS)
default.conf: default.conf.in
cat default.conf.in | sed -e 's,@SHAREDIR@,'"$(SHAREDIR)"',g' -e 's,@PROGNAME@,'"$(PROGNAME)"',g' -e 's,@SYSCONFDIR@,'"$(SYSCONFDIR)"',g' > default.conf
install: all
mkdir -p $(DESTDIR)/$(BINDIR)
$(INSTALL) -m755 $(PROGNAME) $(DESTDIR)/$(BINDIR)
mkdir -p $(DESTDIR)/$(MAN1DIR)
$(INSTALL) -m644 docs/man.1 $(DESTDIR)/$(MAN1DIR)/$(PROGNAME).$(MANSUF)
$(MKDIR) $(DESTDIR)/$(SYSCONFDIR)
if test -f $(DESTDIR)/$(SYSCONFDIR)/$(PROGNAME).conf; then \
$(INSTALL) -m644 default.conf $(DESTDIR)/$(SYSCONFDIR)/$(PROGNAME).conf.new; \
else\
$(INSTALL) -m644 default.conf $(DESTDIR)/$(SYSCONFDIR)/$(PROGNAME).conf;\
fi
$(MKDIR) $(DESTDIR)/$(SHAREDIR)
( cd wordlists && \
for g in $(WORDLISTS); do \
$(INSTALL) -m644 $$g $(DESTDIR)/$(SHAREDIR)/; \
done \
)
( cd $(DESTDIR)/$(SHAREDIR) && rm -f default.gz && $(LN) $(DEFWL) default.gz )
myadns: myadns.c ext/xmalloc.o misc.o
$(CC) $(CFLAGS) -D_WRAP_ -c myadns.c
$(CC) $(CFLAGS) -o myadns ext/xmalloc.o myadns.o misc.o $(LIBS)
rm -f myadns.o
ext/hash: ext/hash.c
$(CC) $(CFLAGS) -D_WRAP_ -o ext/hash ext/hash.c
debug: clean
(cd ext && rm xmalloc.[ch] && ln -s _xdebug.c xmalloc.c && ln -s _xdebug.h xmalloc.h )
nodebug: clean
(cd ext && rm xmalloc.[ch] && ln -s _xmalloc.c xmalloc.c && ln -s _xmalloc.h xmalloc.h )
uninstall:
-rm -f $(BINDIR)/$(PROGNAME)
-if test -d $(MAN1DIR); then \
rm -f $(MAN1DIR)/$(PROGNAME).$(MANSUF); \
fi
-if test -d $(SHAREDIR); then \
( cd $(SHAREDIR) && rm -f $(WORDLISTS) ); \
rmdir $(SHAREDIR); \
fi
-if test -d $(SYSCONFDIR); then \
rm -f $(SYSCONFDIR)/$(PROGNAME).conf; \
rmdir $(SYSCONFDIR); \
fi
tags:
cscope -Rqb
clean:
rm -rf core $(OBJS) $(PROGNAME) cscope.* gmon.out myadns ext/hash default.conf
$(USE_MAKE) -C docs clean
slack:
./scripts/mkslackpkg
check: all
./scripts/runtests.sh
distclean: clean
rm -rf configure Makefile.inc config.log config.status autom4te.cache config.h packages stage
$(USE_MAKE) -C docs distclean
dist: distclean
./scripts/mkdist.sh