xref: /freebsd/contrib/libpcap/rpcapd/Makefile.in (revision 2f513db7)
1#  Copyright (c) 1993, 1994, 1995, 1996
2# 	The Regents of the University of California.  All rights reserved.
3#
4#  Redistribution and use in source and binary forms, with or without
5#  modification, are permitted provided that: (1) source code distributions
6#  retain the above copyright notice and this paragraph in its entirety, (2)
7#  distributions including binary code include the above copyright notice and
8#  this paragraph in its entirety in the documentation or other materials
9#  provided with the distribution, and (3) all advertising materials mentioning
10#  features or use of this software display the following acknowledgement:
11#  ``This product includes software developed by the University of California,
12#  Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
13#  the University nor the names of its contributors may be used to endorse
14#  or promote products derived from this software without specific prior
15#  written permission.
16#  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
17#  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
18#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19
20#
21# Various configurable paths (remember to edit Makefile.in, not Makefile)
22#
23
24# Top level hierarchy
25prefix = @prefix@
26exec_prefix = @exec_prefix@
27datarootdir = @datarootdir@
28# Pathname of directory to install the configure program
29bindir = @bindir@
30# Pathname of directory to install the rpcapd daemon
31sbindir = @sbindir@
32# Pathname of directory to install the include files
33includedir = @includedir@
34# Pathname of directory to install the library
35libdir =  @libdir@
36# Pathname of directory to install the man pages
37mandir = @mandir@
38
39# VPATH
40srcdir = @srcdir@
41VPATH = @srcdir@
42
43#
44# You shouldn't need to edit anything below.
45#
46
47LD = /usr/bin/ld
48CC = @CC@
49AR = @AR@
50LN_S = @LN_S@
51MKDEP = @MKDEP@
52CCOPT = @V_CCOPT@
53INCLS = -I. -I.. -I@srcdir@ -I@srcdir@/.. @V_INCLS@
54DEFS = @DEFS@ @V_DEFS@
55ADDLOBJS = @ADDLOBJS@
56ADDLARCHIVEOBJS = @ADDLARCHIVEOBJS@
57LIBS = @LIBS@
58PTHREAD_LIBS = @PTHREAD_LIBS@
59CROSSFLAGS=
60CFLAGS = @CFLAGS@   ${CROSSFLAGS}
61LDFLAGS = @LDFLAGS@ ${CROSSFLAGS}
62DYEXT = @DYEXT@
63V_RPATH_OPT = @V_RPATH_OPT@
64DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@
65PROG=libpcap
66RPCAPD_LIBS = @RPCAPD_LIBS@
67
68# Standard CFLAGS
69FULL_CFLAGS = $(CCOPT) @V_PROG_CCOPT_FAT@ $(INCLS) $(DEFS) $(CFLAGS)
70
71INSTALL = @INSTALL@
72INSTALL_PROGRAM = @INSTALL_PROGRAM@
73INSTALL_DATA = @INSTALL_DATA@
74
75# Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
76# Also, gcc does not remove the .o before forking 'as', which can be a
77# problem if you don't own the file but can write to the directory.
78.c.o:
79	@rm -f $@
80	$(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c
81
82SRC =	daemon.c \
83	fileconf.c \
84	log.c \
85	rpcapd.c
86
87OBJ =	$(SRC:.c=.o) ../rpcap-protocol.o ../sockutils.o ../fmtutils.o
88PUBHDR =
89
90HDR = $(PUBHDR) log.h
91
92TAGFILES = \
93	$(SRC) $(HDR)
94
95CLEANFILES = $(OBJ) rpcapd
96
97MANADMIN = \
98	rpcapd.manadmin.in
99
100MANFILE = \
101	rpcapd-config.manfile.in
102
103rpcapd: $(OBJ) ../libpcap.a
104	$(CC) $(CCOPT) $(CFLAGS) $(LDFLAGS) @V_PROG_LDFLAGS_FAT@ \
105	    -o $@ $(OBJ) ../libpcap.a $(LIBS) $(RPCAPD_LIBS) $(PTHREAD_LIBS)
106clean:
107	rm -f $(CLEANFILES)
108
109distclean: clean
110	rm -f Makefile config.cache config.log config.status \
111	    config.h stamp-h stamp-h.in
112	rm -f $(MANADMIN:.in=) $(MANFILE:.in=)
113	rm -rf autom4te.cache
114
115install: rpcapd
116	[ -d $(DESTDIR)$(sbindir) ] || \
117	    (mkdir -p $(DESTDIR)$(sbindir); chmod 755 $(DESTDIR)$(sbindir))
118	$(INSTALL_PROGRAM) rpcapd $(DESTDIR)$(sbindir)/rpcapd
119	[ -d $(DESTDIR)$(mandir)/man@MAN_ADMIN_COMMANDS@ ] || \
120	    (mkdir -p $(DESTDIR)$(mandir)/man@MAN_ADMIN_COMMANDS@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_ADMIN_COMMANDS@)
121	[ -d $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@ ] || \
122	    (mkdir -p $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@)
123	for i in $(MANADMIN); do \
124		$(INSTALL_DATA) `echo $$i | sed 's/.manadmin.in/.manadmin/'` \
125		    $(DESTDIR)$(mandir)/man@MAN_ADMIN_COMMANDS@/`echo $$i | sed 's/.manadmin.in/.@MAN_ADMIN_COMMANDS@/'`; done
126	for i in $(MANFILE); do \
127		$(INSTALL_DATA) `echo $$i | sed 's/.manfile.in/.manfile/'` \
128		    $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
129
130uninstall:
131	rm -f $(DESTDIR)$(sbindir)/rpcapd
132	for i in $(MANADMIN); do \
133		rm -f $(DESTDIR)$(mandir)/man@MAN_ADMIN_COMMANDS@/`echo $$i | sed 's/.manadmin.in/.@MAN_ADMIN_COMMANDS@/'`; done
134	for i in $(MANFILE); do \
135		rm -f $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
136
137tags: $(TAGFILES)
138	ctags -wtd $(TAGFILES)
139
140depend:
141	../$(MKDEP) -c "$(CC)" -m "$(DEPENDENCY_CFLAG)" $(CFLAGS) $(DEFS) $(INCLS) $(SRC)
142