-
Notifications
You must be signed in to change notification settings - Fork 102
/
Copy pathMakefile.in
85 lines (64 loc) · 2.93 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
#
# Copyright (c) 2017 Jordan Ritter <[email protected]>
#
# Please refer to the LICENSE file for more information.
CC=@CC@
CPPFLAGS = @DEFS@ -D@OS@ @EXTRA_DEFINES@ @CPPFLAGS@
CFLAGS = @EXTRA_INCLUDES@ @CFLAGS@
LDFLAGS = @EXTRA_LDFLAGS@ @LDFLAGS@
LIBS = @LIBS@ @EXTRA_LIBS@
STRIPFLAG=@STRIPFLAG@
OBJS=ngrep.o @EXTRA_OBJS@
TARGET=ngrep
MANPAGE=ngrep.8
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
datadir = @datadir@
mandir = @mandir@
BINDIR_INSTALL = $(bindir)
MANDIR_INSTALL = $(mandir)/man8
INSTALL = ./install-sh
REGEX_OBJS=@REGEX_OBJS@
REGEX_DIR=@REGEX_DIR@
all: $(TARGET)
$(TARGET): $(REGEX_OBJS) $(OBJS)
$(CC) $(STRIPFLAG) -o $(TARGET) $(OBJS) $(REGEX_OBJS) $(LDFLAGS) $(LIBS)
debug: $(REGEX_OBJS) $(OBJS)
$(CC) -g -o $(TARGET) $(OBJS) $(REGEX_OBJS) $(LDFLAGS) $(LIBS)
static: $(REGEX_OBJS) $(OBJS)
$(CC) $(STRIPFLAG) -static -o $(TARGET).static $(OBJS) $(REGEX_OBJS) $(LDFLAGS) $(LIBS)
install: $(TARGET)
$(INSTALL) -c -m 0755 $(TARGET) $(DESTDIR)/$(BINDIR_INSTALL)/$(TARGET)
$(INSTALL) -c -m 0644 $(MANPAGE) $(DESTDIR)/$(MANDIR_INSTALL)/$(MANPAGE)
.c.o:
$(CC) $(CPPFLAGS) $(CFLAGS) -g -c $<
clean:
test -n "$(REGEX_DIR)" && $(MAKE) -C $(REGEX_DIR) clean || exit 0
rm -f *~ $(OBJS) $(REGEX_OBJS) $(TARGET) $(TARGET).static
distclean: clean
test -n "$(REGEX_DIR)" && $(MAKE) -C $(REGEX_DIR) distclean || exit 0
rm -f config.status config.cache config.log config.h Makefile
$(REGEX_OBJS): $(REGEX_OBJS:.o=.c) $(REGEX_DIR)/*.h
$(MAKE) $(MAKEFLAGS) -C $(REGEX_DIR) $(notdir $(REGEX_OBJS))
$(OBJS): Makefile $(OBJS:.o=.c) $(OBJS:.o=.h)
tardist:
@( VERSION=`perl -ne '/VERSION\s+"(.*)"/ && print "$$1\n"' ngrep.h` ; \
PKG="ngrep-$$VERSION" ; \
TMPDIR="/tmp" ; \
DESTDIR="$$TMPDIR/$$PKG" ; \
echo ; \
echo "Building package $$PKG ... " ; \
echo ; \
sleep 2 ; \
rm -rf $$DESTDIR && mkdir $$DESTDIR && \
make distclean && \
tar --exclude "CVS" -cf - . | tar xf - -C $$DESTDIR && \
find $$DESTDIR -name "*~" -o -name ".*#*" | xargs rm -f && \
cd $$TMPDIR && tar zcf $$PKG.tar.gz $$PKG ; \
rm -rf $$DESTDIR ; \
cd $$TMPDIR && gpg -ba $$PKG.tar.gz ; \
echo ; \
ls -l $$TMPDIR/$$PKG.tar.gz $$TMPDIR/$$PKG.tar.gz.asc ; \
echo ; \
)