Makefile.in 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756
  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. # Various configurable paths (remember to edit Makefile.in, not Makefile)
  21. #
  22. # Top level hierarchy
  23. prefix = @prefix@
  24. exec_prefix = @exec_prefix@
  25. datarootdir = @datarootdir@
  26. # Pathname of directory to install the configure program
  27. bindir = @bindir@
  28. # Pathname of directory to install the rpcapd daemon
  29. sbindir = @sbindir@
  30. # Pathname of directory to install the include files
  31. includedir = @includedir@
  32. # Pathname of directory to install the library
  33. libdir = @libdir@
  34. # Pathname of directory to install the man pages
  35. mandir = @mandir@
  36. # VPATH
  37. srcdir = @srcdir@
  38. VPATH = @srcdir@
  39. #
  40. # You shouldn't need to edit anything below.
  41. #
  42. LD = /usr/bin/ld
  43. CC = @CC@
  44. AR = @AR@
  45. LN_S = @LN_S@
  46. MKDEP = @MKDEP@
  47. CCOPT = @V_CCOPT@
  48. SHLIB_CCOPT = @V_SHLIB_CCOPT@
  49. INCLS = -I. @V_INCLS@
  50. DEFS = -DBUILDING_PCAP -Dpcap_EXPORTS @DEFS@ @V_DEFS@
  51. ADDLOBJS = @ADDLOBJS@
  52. ADDLARCHIVEOBJS = @ADDLARCHIVEOBJS@
  53. LIBS = @LIBS@
  54. CROSSFLAGS=
  55. CFLAGS = @CFLAGS@ ${CROSSFLAGS}
  56. LDFLAGS = @LDFLAGS@ ${CROSSFLAGS}
  57. DYEXT = @DYEXT@
  58. V_RPATH_OPT = @V_RPATH_OPT@
  59. DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@
  60. PROG=libpcap
  61. PTHREAD_LIBS=@PTHREAD_LIBS@
  62. BUILD_RPCAPD=@BUILD_RPCAPD@
  63. INSTALL_RPCAPD=@INSTALL_RPCAPD@
  64. EXTRA_NETWORK_LIBS=@EXTRA_NETWORK_LIBS@
  65. # Standard CFLAGS for building members of a shared library
  66. FULL_CFLAGS = $(CCOPT) $(SHLIB_CCOPT) $(INCLS) $(DEFS) $(CFLAGS)
  67. INSTALL = @INSTALL@
  68. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  69. INSTALL_DATA = @INSTALL_DATA@
  70. RANLIB = @RANLIB@
  71. LEX = @LEX@
  72. YACC = @YACC@
  73. # Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
  74. # Also, gcc does not remove the .o before forking 'as', which can be a
  75. # problem if you don't own the file but can write to the directory.
  76. .c.o:
  77. @rm -f $@
  78. $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c
  79. PSRC = pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @BT_MONITOR_SRC@ @NETFILTER_SRC@ @DBUS_SRC@ @NETMAP_SRC@ @RDMA_SRC@
  80. FSRC = @V_FINDALLDEVS@
  81. SSRC = @SSRC@
  82. CSRC = pcap.c gencode.c optimize.c nametoaddr.c etherent.c \
  83. fmtutils.c \
  84. savefile.c sf-pcap.c sf-pcapng.c pcap-common.c \
  85. bpf_image.c bpf_filter.c bpf_dump.c
  86. GENSRC = scanner.c grammar.c
  87. LIBOBJS = @LIBOBJS@
  88. SRC = $(PSRC) $(FSRC) $(CSRC) $(SSRC) $(GENSRC)
  89. # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
  90. # hack the extra indirection
  91. OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS)
  92. PUBHDR = \
  93. pcap.h \
  94. pcap-bpf.h \
  95. pcap-namedb.h \
  96. pcap/bpf.h \
  97. pcap/bluetooth.h \
  98. pcap/can_socketcan.h \
  99. pcap/compiler-tests.h \
  100. pcap/dlt.h \
  101. pcap/funcattrs.h \
  102. pcap/pcap-inttypes.h \
  103. pcap/ipnet.h \
  104. pcap/namedb.h \
  105. pcap/nflog.h \
  106. pcap/pcap.h \
  107. pcap/sll.h \
  108. pcap/vlan.h \
  109. pcap/usb.h
  110. HDR = $(PUBHDR) \
  111. arcnet.h \
  112. atmuni31.h \
  113. diag-control.h \
  114. ethertype.h \
  115. extract.h \
  116. fmtutils.h \
  117. ftmacros.h \
  118. gencode.h \
  119. ieee80211.h \
  120. llc.h \
  121. nametoaddr.h \
  122. nlpid.h \
  123. optimize.h \
  124. pcap-common.h \
  125. pcap-int.h \
  126. pcap-rpcap.h \
  127. pcap-types.h \
  128. portability.h \
  129. ppp.h \
  130. rpcap-protocol.h \
  131. sf-pcap.h \
  132. sf-pcapng.h \
  133. sunatmpos.h \
  134. varattrs.h
  135. GENHDR = \
  136. scanner.h grammar.h
  137. TAGFILES = \
  138. $(SRC) $(HDR)
  139. CLEANFILES = $(OBJ) libpcap.a libpcap.so.`cat $(srcdir)/VERSION` \
  140. $(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \
  141. lex.yy.c pcap-config libpcap.pc
  142. MAN1 = pcap-config.1
  143. MAN3PCAP_EXPAND = \
  144. pcap.3pcap.in \
  145. pcap_compile.3pcap.in \
  146. pcap_datalink.3pcap.in \
  147. pcap_dump_open.3pcap.in \
  148. pcap_get_tstamp_precision.3pcap.in \
  149. pcap_list_datalinks.3pcap.in \
  150. pcap_list_tstamp_types.3pcap.in \
  151. pcap_open_dead.3pcap.in \
  152. pcap_open_offline.3pcap.in \
  153. pcap_set_tstamp_precision.3pcap.in \
  154. pcap_set_tstamp_type.3pcap.in
  155. MAN3PCAP_NOEXPAND = \
  156. pcap_activate.3pcap \
  157. pcap_breakloop.3pcap \
  158. pcap_can_set_rfmon.3pcap \
  159. pcap_close.3pcap \
  160. pcap_create.3pcap \
  161. pcap_datalink_name_to_val.3pcap \
  162. pcap_datalink_val_to_name.3pcap \
  163. pcap_dump.3pcap \
  164. pcap_dump_close.3pcap \
  165. pcap_dump_file.3pcap \
  166. pcap_dump_flush.3pcap \
  167. pcap_dump_ftell.3pcap \
  168. pcap_file.3pcap \
  169. pcap_fileno.3pcap \
  170. pcap_findalldevs.3pcap \
  171. pcap_freecode.3pcap \
  172. pcap_get_required_select_timeout.3pcap \
  173. pcap_get_selectable_fd.3pcap \
  174. pcap_geterr.3pcap \
  175. pcap_inject.3pcap \
  176. pcap_is_swapped.3pcap \
  177. pcap_lib_version.3pcap \
  178. pcap_lookupdev.3pcap \
  179. pcap_lookupnet.3pcap \
  180. pcap_loop.3pcap \
  181. pcap_major_version.3pcap \
  182. pcap_next_ex.3pcap \
  183. pcap_offline_filter.3pcap \
  184. pcap_open_live.3pcap \
  185. pcap_set_buffer_size.3pcap \
  186. pcap_set_datalink.3pcap \
  187. pcap_set_immediate_mode.3pcap \
  188. pcap_set_promisc.3pcap \
  189. pcap_set_protocol_linux.3pcap \
  190. pcap_set_rfmon.3pcap \
  191. pcap_set_snaplen.3pcap \
  192. pcap_set_timeout.3pcap \
  193. pcap_setdirection.3pcap \
  194. pcap_setfilter.3pcap \
  195. pcap_setnonblock.3pcap \
  196. pcap_snapshot.3pcap \
  197. pcap_stats.3pcap \
  198. pcap_statustostr.3pcap \
  199. pcap_strerror.3pcap \
  200. pcap_tstamp_type_name_to_val.3pcap \
  201. pcap_tstamp_type_val_to_name.3pcap
  202. MAN3PCAP = $(MAN3PCAP_NOEXPAND) $(MAN3PCAP_EXPAND:.in=)
  203. MANFILE = \
  204. pcap-savefile.manfile.in
  205. MANMISC = \
  206. pcap-filter.manmisc.in \
  207. pcap-linktype.manmisc.in \
  208. pcap-tstamp.manmisc.in
  209. EXTRA_DIST = \
  210. CHANGES \
  211. ChmodBPF/ChmodBPF \
  212. ChmodBPF/StartupParameters.plist \
  213. CREDITS \
  214. CMakeLists.txt \
  215. INSTALL.md \
  216. LICENSE \
  217. Makefile.in \
  218. Makefile-devel-adds \
  219. README.md \
  220. doc \
  221. CONTRIBUTING.md \
  222. TODO \
  223. VERSION \
  224. aclocal.m4 \
  225. chmod_bpf \
  226. cmake_uninstall.cmake.in \
  227. cmakeconfig.h.in \
  228. cmake/Modules/FindDAG.cmake \
  229. cmake/Modules/FindFseeko.cmake \
  230. cmake/Modules/FindLFS.cmake \
  231. cmake/Modules/FindPacket.cmake \
  232. cmake/Modules/FindSNF.cmake \
  233. cmake/Modules/FindTC.cmake \
  234. cmake/have_siocglifconf.c \
  235. config.guess \
  236. config.h.in \
  237. config.sub \
  238. configure \
  239. configure.ac \
  240. dlpisubs.c \
  241. dlpisubs.h \
  242. fad-getad.c \
  243. fad-gifc.c \
  244. fad-glifc.c \
  245. grammar.y \
  246. install-sh \
  247. lbl/os-aix4.h \
  248. lbl/os-aix7.h \
  249. lbl/os-hpux11.h \
  250. lbl/os-osf4.h \
  251. lbl/os-osf5.h \
  252. lbl/os-solaris2.h \
  253. lbl/os-sunos4.h \
  254. lbl/os-ultrix4.h \
  255. libpcap.pc.in \
  256. missing/getopt.c \
  257. missing/getopt.h \
  258. missing/snprintf.c \
  259. missing/strtok_r.c \
  260. missing/win_snprintf.c \
  261. mkdep \
  262. msdos/bin2c.c \
  263. msdos/makefile \
  264. msdos/makefile.dj \
  265. msdos/makefile.wc \
  266. msdos/pkt_rx0.asm \
  267. msdos/pkt_rx1.s \
  268. msdos/pktdrvr.c \
  269. msdos/pktdrvr.h \
  270. msdos/readme.dos \
  271. nomkdep \
  272. org.tcpdump.chmod_bpf.plist \
  273. pcap-bpf.c \
  274. pcap-bt-linux.c \
  275. pcap-bt-linux.h \
  276. pcap-bt-monitor-linux.c \
  277. pcap-bt-monitor-linux.h \
  278. pcap-config.in \
  279. pcap-dag.c \
  280. pcap-dag.h \
  281. pcap-dbus.c \
  282. pcap-dbus.h \
  283. pcap-dll.rc \
  284. pcap-dlpi.c \
  285. pcap-dos.c \
  286. pcap-dos.h \
  287. pcap-enet.c \
  288. pcap-int.h \
  289. pcap-libdlpi.c \
  290. pcap-linux.c \
  291. pcap-namedb.h \
  292. pcap-new.c \
  293. pcap-netfilter-linux.c \
  294. pcap-netfilter-linux.h \
  295. pcap-netmap.c \
  296. pcap-netmap.h \
  297. pcap-nit.c \
  298. pcap-npf.c \
  299. pcap-null.c \
  300. pcap-pf.c \
  301. pcap-rdmasniff.c \
  302. pcap-rdmasniff.h \
  303. pcap-rpcap.c \
  304. pcap-rpcap-int.h \
  305. pcap-septel.c \
  306. pcap-septel.h \
  307. pcap-sita.h \
  308. pcap-sita.c \
  309. pcap-sita.html \
  310. pcap-snf.c \
  311. pcap-snf.h \
  312. pcap-snit.c \
  313. pcap-snoop.c \
  314. pcap-tc.c \
  315. pcap-tc.h \
  316. pcap-usb-linux.c \
  317. pcap-usb-linux.h \
  318. rpcap-protocol.c \
  319. rpcapd/CMakeLists.txt \
  320. rpcapd/Makefile.in \
  321. rpcapd/config_params.h \
  322. rpcapd/daemon.h \
  323. rpcapd/daemon.c \
  324. rpcapd/fileconf.c \
  325. rpcapd/fileconf.h \
  326. rpcapd/log.h \
  327. rpcapd/log-stderr.c \
  328. rpcapd/org.tcpdump.rpcapd.plist \
  329. rpcapd/rpcapd.c \
  330. rpcapd/rpcapd.h \
  331. rpcapd/rpcapd.inetd.conf \
  332. rpcapd/rpcapd.manadmin.in \
  333. rpcapd/rpcapd.rc \
  334. rpcapd/rpcapd.socket \
  335. rpcapd/rpcapd.xinetd.conf \
  336. rpcapd/rpcapd@.service \
  337. rpcapd/win32-svc.c \
  338. rpcapd/win32-svc.h \
  339. sockutils.c \
  340. sockutils.h \
  341. scanner.l \
  342. testprogs/CMakeLists.txt \
  343. testprogs/Makefile.in \
  344. testprogs/can_set_rfmon_test.c \
  345. testprogs/capturetest.c \
  346. testprogs/filtertest.c \
  347. testprogs/findalldevstest.c \
  348. testprogs/opentest.c \
  349. testprogs/reactivatetest.c \
  350. testprogs/selpolltest.c \
  351. testprogs/threadsignaltest.c \
  352. testprogs/unix.h \
  353. testprogs/valgrindtest.c \
  354. tests/shb-option-too-long.pcapng \
  355. Win32/Prj/wpcap.sln \
  356. Win32/Prj/wpcap.vcxproj \
  357. Win32/Prj/wpcap.vcxproj.filters
  358. all: libpcap.a shared $(BUILD_RPCAPD) libpcap.pc pcap-config
  359. libpcap.a: $(OBJ)
  360. @rm -f $@
  361. $(AR) rc $@ $(OBJ) $(ADDLARCHIVEOBJS)
  362. $(RANLIB) $@
  363. shared: libpcap.$(DYEXT)
  364. libpcap.so: $(OBJ)
  365. @rm -f $@
  366. VER=`cat $(srcdir)/VERSION`; \
  367. MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
  368. @V_SHLIB_CMD@ $(LDFLAGS) @V_SHLIB_OPT@ @V_SONAME_OPT@$@.$$MAJOR_VER \
  369. -o $@.$$VER $(OBJ) $(ADDLOBJS) $(LIBS)
  370. #
  371. # The following rule succeeds, but the result is untested.
  372. #
  373. # In macOS, the libpcap dylib has the name "libpcap.A.dylib", with its
  374. # full path as the install_name, and with the compatibility and current
  375. # version both set to 1. The compatibility version is set to 1 so that
  376. # programs built with a newer version of the library will run against
  377. # older versions if they don't use APIs available in the newer version
  378. # but not in the older version.
  379. #
  380. # We also use "A" as the major version, and 1 as the compatibility version,
  381. # but set the current version to the value in VERSION, with any non-numeric
  382. # stuff stripped off (the compatibility and current version must be of the
  383. # form X[.Y[.Z]], with Y and Z possibly absent, and with all components
  384. # numeric).
  385. #
  386. libpcap.dylib: $(OBJ)
  387. rm -f libpcap*.dylib
  388. VER=`cat $(srcdir)/VERSION`; \
  389. MAJOR_VER=A; \
  390. COMPAT_VER=1; \
  391. CURRENT_VER=`sed 's/[^0-9.].*$$//' $(srcdir)/VERSION`; \
  392. $(CC) -dynamiclib -undefined error $(LDFLAGS) \
  393. -o libpcap.$$VER.dylib $(OBJ) $(ADDLOBJS) $(LIBS) \
  394. -install_name $(libdir)/libpcap.$$MAJOR_VER.dylib \
  395. -compatibility_version $$COMPAT_VER \
  396. -current_version $$CURRENT_VER
  397. #
  398. # The HP-UX linker manual says that the convention for a versioned library
  399. # is libXXX.{number}, not libXXX.sl.{number}. That appears to be the case
  400. # on at least one HP-UX 11.00 system; libXXX.sl is a symlink to
  401. # libXXX.{number}.
  402. #
  403. # The manual also says "library-level versioning" (think "sonames") was
  404. # added in HP-UX 10.0.
  405. #
  406. # XXX - this assumes we're using the HP linker, rather than the GNU
  407. # linker, even with GCC.
  408. #
  409. libpcap.sl: $(OBJ)
  410. @MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
  411. rm -f libpcap.$$MAJOR_VER
  412. MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
  413. ld -b $(LDFLAGS) -o libpcap.$$MAJOR_VER +h libpcap.$$MAJOR_VER \
  414. $(OBJ) $(ADDLOBJS) $(LIBS)
  415. #
  416. # AIX is different from everybody else. A shared library is an archive
  417. # library with one or more shared-object components. We still build a
  418. # normal static archive library on AIX, for the benefit of the traditional
  419. # scheme of building libpcap and tcpdump in subdirectories of the
  420. # same directory, with tcpdump statically linked with the libpcap
  421. # in question, but we also build a shared library as "libpcap.shareda"
  422. # and install *it*, rather than the static library, as "libpcap.a".
  423. #
  424. libpcap.shareda: $(OBJ)
  425. @rm -f $@ shr.o
  426. $(CC) $(LDFLAGS) @V_SHLIB_OPT@ -o shr.o $(OBJ) $(ADDLOBJS) $(LIBS)
  427. $(AR) rc $@ shr.o
  428. #
  429. # For platforms that don't support shared libraries (or on which we
  430. # don't support shared libraries).
  431. #
  432. libpcap.none:
  433. scanner.c: $(srcdir)/scanner.l
  434. $(LEX) -P pcap_ --header-file=scanner.h --nounput -o scanner.c $<
  435. scanner.h: scanner.c
  436. ## Recover from the removal of $@
  437. @if test -f $@; then :; else \
  438. rm -f scanner.c; \
  439. $(MAKE) $(MAKEFLAGS) scanner.c; \
  440. fi
  441. scanner.o: scanner.c grammar.h
  442. $(CC) $(FULL_CFLAGS) -c scanner.c
  443. grammar.c: $(srcdir)/grammar.y
  444. $(YACC) -p pcap_ -o grammar.c -d $<
  445. grammar.h: grammar.c
  446. ## Recover from the removal of $@
  447. @if test -f $@; then :; else \
  448. rm -f grammar.c; \
  449. $(MAKE) $(MAKEFLAGS) grammar.c; \
  450. fi
  451. grammar.o: grammar.c scanner.h
  452. $(CC) $(FULL_CFLAGS) -c grammar.c
  453. gencode.o: $(srcdir)/gencode.c grammar.h scanner.h
  454. $(CC) $(FULL_CFLAGS) -c $(srcdir)/gencode.c
  455. snprintf.o: $(srcdir)/missing/snprintf.c
  456. $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
  457. strtok_r.o: $(srcdir)/missing/strtok_r.c
  458. $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strtok_r.c
  459. #
  460. # Generate the libpcap.pc file.
  461. #
  462. # Some Makes, e.g. AIX Make and Solaris Make, can't handle "--file=$@.tmp:$<";
  463. # for example, the Solaris 9 make man page says
  464. #
  465. # Because make assigns $< and $* as it would for implicit rules
  466. # (according to the suffixes list and the directory contents),
  467. # they may be unreliable when used within explicit target entries.
  468. #
  469. # and this is an explicit target entry.
  470. #
  471. # Therefore, instead of using $<, we explicitly put in $(srcdir)/libpcap.pc.in.
  472. #
  473. libpcap.pc: $(srcdir)/libpcap.pc.in ./config.status
  474. @rm -f $@ $@.tmp
  475. ./config.status --file=$@.tmp:$(srcdir)/libpcap.pc.in
  476. mv $@.tmp $@
  477. chmod a+x $@
  478. #
  479. # Generate the pcap-config script. See above.
  480. #
  481. pcap-config: $(srcdir)/pcap-config.in ./config.status
  482. @rm -f $@ $@.tmp
  483. ./config.status --file=$@.tmp:$(srcdir)/pcap-config.in
  484. mv $@.tmp $@
  485. chmod a+x $@
  486. #
  487. # Remote pcap daemon.
  488. #
  489. build-rpcapd: libpcap.a
  490. cd rpcapd; $(MAKE)
  491. #
  492. # Test programs - not built by default, and not installed.
  493. #
  494. testprogs: FORCE
  495. cd testprogs; $(MAKE)
  496. FORCE:
  497. install: install-shared install-archive libpcap.pc pcap-config @INSTALL_RPCAPD@
  498. [ -d $(DESTDIR)$(libdir) ] || \
  499. (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
  500. [ -d $(DESTDIR)$(includedir) ] || \
  501. (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
  502. [ -d $(DESTDIR)$(includedir)/pcap ] || \
  503. (mkdir -p $(DESTDIR)$(includedir)/pcap; chmod 755 $(DESTDIR)$(includedir)/pcap)
  504. [ -d $(DESTDIR)$(mandir)/man1 ] || \
  505. (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
  506. [ -d $(DESTDIR)$(mandir)/man3 ] || \
  507. (mkdir -p $(DESTDIR)$(mandir)/man3; chmod 755 $(DESTDIR)$(mandir)/man3)
  508. [ -d $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@ ] || \
  509. (mkdir -p $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@)
  510. [ -d $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@ ] || \
  511. (mkdir -p $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@)
  512. for i in $(PUBHDR); do \
  513. $(INSTALL_DATA) $(srcdir)/$$i \
  514. $(DESTDIR)$(includedir)/$$i; done
  515. [ -d $(DESTDIR)$(bindir) ] || \
  516. (mkdir -p $(DESTDIR)$(bindir); chmod 755 $(DESTDIR)$(bindir))
  517. $(INSTALL_PROGRAM) pcap-config $(DESTDIR)$(bindir)/pcap-config
  518. [ -d $(DESTDIR)$(libdir)/pkgconfig ] || \
  519. (mkdir -p $(DESTDIR)$(libdir)/pkgconfig; chmod 755 $(DESTDIR)$(libdir)/pkgconfig)
  520. $(INSTALL_DATA) libpcap.pc $(DESTDIR)$(libdir)/pkgconfig/libpcap.pc
  521. for i in $(MAN1); do \
  522. $(INSTALL_DATA) $(srcdir)/$$i \
  523. $(DESTDIR)$(mandir)/man1/$$i; done
  524. for i in $(MAN3PCAP_NOEXPAND); do \
  525. $(INSTALL_DATA) $(srcdir)/$$i \
  526. $(DESTDIR)$(mandir)/man3/$$i; done
  527. for i in $(MAN3PCAP_EXPAND:.in=); do \
  528. $(INSTALL_DATA) $$i \
  529. $(DESTDIR)$(mandir)/man3/$$i; done
  530. (cd $(DESTDIR)$(mandir)/man3 && \
  531. rm -f pcap_datalink_val_to_description.3pcap && \
  532. $(LN_S) pcap_datalink_val_to_name.3pcap \
  533. pcap_datalink_val_to_description.3pcap && \
  534. rm -f pcap_dump_fopen.3pcap && \
  535. $(LN_S) pcap_dump_open.3pcap pcap_dump_fopen.3pcap && \
  536. rm -f pcap_freealldevs.3pcap && \
  537. $(LN_S) pcap_findalldevs.3pcap pcap_freealldevs.3pcap && \
  538. rm -f pcap_perror.3pcap && \
  539. $(LN_S) pcap_geterr.3pcap pcap_perror.3pcap && \
  540. rm -f pcap_sendpacket.3pcap && \
  541. $(LN_S) pcap_inject.3pcap pcap_sendpacket.3pcap && \
  542. rm -f pcap_free_datalinks.3pcap && \
  543. $(LN_S) pcap_list_datalinks.3pcap pcap_free_datalinks.3pcap && \
  544. rm -f pcap_free_tstamp_types.3pcap && \
  545. $(LN_S) pcap_list_tstamp_types.3pcap pcap_free_tstamp_types.3pcap && \
  546. rm -f pcap_dispatch.3pcap && \
  547. $(LN_S) pcap_loop.3pcap pcap_dispatch.3pcap && \
  548. rm -f pcap_minor_version.3pcap && \
  549. $(LN_S) pcap_major_version.3pcap pcap_minor_version.3pcap && \
  550. rm -f pcap_next.3pcap && \
  551. $(LN_S) pcap_next_ex.3pcap pcap_next.3pcap && \
  552. rm -f pcap_open_dead_with_tstamp_precision.3pcap && \
  553. $(LN_S) pcap_open_dead.3pcap \
  554. pcap_open_dead_with_tstamp_precision.3pcap && \
  555. rm -f pcap_open_offline_with_tstamp_precision.3pcap && \
  556. $(LN_S) pcap_open_offline.3pcap pcap_open_offline_with_tstamp_precision.3pcap && \
  557. rm -f pcap_fopen_offline.3pcap && \
  558. $(LN_S) pcap_open_offline.3pcap pcap_fopen_offline.3pcap && \
  559. rm -f pcap_fopen_offline_with_tstamp_precision.3pcap && \
  560. $(LN_S) pcap_open_offline.3pcap pcap_fopen_offline_with_tstamp_precision.3pcap && \
  561. rm -f pcap_tstamp_type_val_to_description.3pcap && \
  562. $(LN_S) pcap_tstamp_type_val_to_name.3pcap pcap_tstamp_type_val_to_description.3pcap && \
  563. rm -f pcap_getnonblock.3pcap && \
  564. $(LN_S) pcap_setnonblock.3pcap pcap_getnonblock.3pcap)
  565. for i in $(MANFILE); do \
  566. $(INSTALL_DATA) `echo $$i | sed 's/.manfile.in/.manfile/'` \
  567. $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
  568. for i in $(MANMISC); do \
  569. $(INSTALL_DATA) `echo $$i | sed 's/.manmisc.in/.manmisc/'` \
  570. $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
  571. install-shared: install-shared-$(DYEXT)
  572. install-shared-so: libpcap.so
  573. [ -d $(DESTDIR)$(libdir) ] || \
  574. (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
  575. VER=`cat $(srcdir)/VERSION`; \
  576. MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
  577. $(INSTALL_PROGRAM) libpcap.so.$$VER $(DESTDIR)$(libdir)/libpcap.so.$$VER; \
  578. ln -sf libpcap.so.$$VER $(DESTDIR)$(libdir)/libpcap.so.$$MAJOR_VER; \
  579. ln -sf libpcap.so.$$MAJOR_VER $(DESTDIR)$(libdir)/libpcap.so
  580. install-shared-dylib: libpcap.dylib
  581. [ -d $(DESTDIR)$(libdir) ] || \
  582. (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
  583. VER=`cat $(srcdir)/VERSION`; \
  584. MAJOR_VER=A; \
  585. $(INSTALL_PROGRAM) libpcap.$$VER.dylib $(DESTDIR)$(libdir)/libpcap.$$VER.dylib; \
  586. ln -sf libpcap.$$VER.dylib $(DESTDIR)$(libdir)/libpcap.$$MAJOR_VER.dylib; \
  587. ln -sf libpcap.$$MAJOR_VER.dylib $(DESTDIR)$(libdir)/libpcap.dylib
  588. install-shared-sl: libpcap.sl
  589. [ -d $(DESTDIR)$(libdir) ] || \
  590. (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
  591. MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
  592. $(INSTALL_PROGRAM) libpcap.$$MAJOR_VER $(DESTDIR)$(libdir)
  593. ln -sf libpcap.$$MAJOR_VER $(DESTDIR)$(libdir)/libpcap.sl
  594. install-shared-shareda: libpcap.shareda
  595. #
  596. # AIX shared libraries are weird. They're archive libraries
  597. # with one or more shared object components.
  598. #
  599. [ -d $(DESTDIR)$(libdir) ] || \
  600. (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
  601. $(INSTALL_PROGRAM) libpcap.shareda $(DESTDIR)$(libdir)/libpcap.a
  602. install-shared-none:
  603. install-archive: install-archive-$(DYEXT)
  604. install-archive-so install-archive-dylib install-archive-sl install-archive-none: libpcap.a
  605. #
  606. # Most platforms have separate suffixes for shared and
  607. # archive libraries, so we install both.
  608. #
  609. [ -d $(DESTDIR)$(libdir) ] || \
  610. (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
  611. $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
  612. $(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
  613. install-archive-shareda:
  614. #
  615. # AIX, however, doesn't, so we don't install the archive
  616. # library on AIX.
  617. #
  618. install-rpcapd:
  619. cd rpcapd; $(MAKE) DESTDIR=$(DESTDIR) install
  620. uninstall: uninstall-shared uninstall-rpcapd
  621. rm -f $(DESTDIR)$(libdir)/libpcap.a
  622. for i in $(PUBHDR); do \
  623. rm -f $(DESTDIR)$(includedir)/$$i; done
  624. -rmdir $(DESTDIR)$(includedir)/pcap
  625. rm -f $(DESTDIR)/$(libdir)/pkgconfig/libpcap.pc
  626. rm -f $(DESTDIR)/$(bindir)/pcap-config
  627. for i in $(MAN1); do \
  628. rm -f $(DESTDIR)$(mandir)/man1/$$i; done
  629. for i in $(MAN3PCAP); do \
  630. rm -f $(DESTDIR)$(mandir)/man3/$$i; done
  631. rm -f $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap
  632. rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
  633. rm -f $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3pcap
  634. rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
  635. rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
  636. rm -f $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3pcap
  637. rm -f $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3pcap
  638. rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
  639. rm -f $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap
  640. rm -f $(DESTDIR)$(mandir)/man3/pcap_next.3pcap
  641. rm -f $(DESTDIR)$(mandir)/man3/pcap_open_dead_with_tstamp_precision.3pcap
  642. rm -f $(DESTDIR)$(mandir)/man3/pcap_open_offline_with_tstamp_precision.3pcap
  643. rm -f $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap
  644. rm -f $(DESTDIR)$(mandir)/man3/pcap_fopen_offline_with_tstamp_precision.3pcap
  645. rm -f $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap
  646. rm -f $(DESTDIR)$(mandir)/man3/pcap_tstamp_type_val_to_description.3pcap
  647. for i in $(MANFILE); do \
  648. rm -f $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
  649. for i in $(MANMISC); do \
  650. rm -f $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
  651. uninstall-shared: uninstall-shared-$(DYEXT)
  652. uninstall-shared-so:
  653. VER=`cat $(srcdir)/VERSION`; \
  654. MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
  655. rm -f $(DESTDIR)$(libdir)/libpcap.so.$$VER; \
  656. rm -f $(DESTDIR)$(libdir)/libpcap.so.$$MAJOR_VER; \
  657. rm -f $(DESTDIR)$(libdir)/libpcap.so
  658. uninstall-shared-dylib:
  659. VER=`cat $(srcdir)/VERSION`; \
  660. MAJOR_VER=A; \
  661. rm -f $(DESTDIR)$(libdir)/libpcap.$$VER.dylib; \
  662. rm -f $(DESTDIR)$(libdir)/libpcap.$$MAJOR_VER.dylib; \
  663. rm -f $(DESTDIR)$(libdir)/libpcap.dylib
  664. uninstall-shared-sl:
  665. MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
  666. rm -f $(DESTDIR)$(libdir)/libpcap.$$MAJOR_VER; \
  667. rm -f $(DESTDIR)$(libdir)/libpcap.sl
  668. uninstall-shared-shareda:
  669. rm -f $(DESTDIR)$(libdir)/libpcap.a
  670. uninstall-shared-none:
  671. uninstall-rpcapd:
  672. cd rpcapd; $(MAKE) DESTDIR=$(DESTDIR) uninstall
  673. clean:
  674. rm -f $(CLEANFILES)
  675. cd rpcapd; $(MAKE) clean
  676. cd testprogs; $(MAKE) clean
  677. distclean: clean
  678. rm -f Makefile config.cache config.log config.status \
  679. config.h gnuc.h net os-proto.h libpcap.pc \
  680. pcap-config stamp-h stamp-h.in
  681. rm -f $(MAN3PCAP_EXPAND:.in=) $(MANFILE:.in=) $(MANMISC:.in=)
  682. rm -rf autom4te.cache
  683. cd rpcapd; $(MAKE) distclean
  684. cd testprogs; $(MAKE) distclean
  685. extags: $(TAGFILES)
  686. ctags $(TAGFILES)
  687. tags: $(TAGFILES)
  688. ctags -wtd $(TAGFILES)
  689. releasetar:
  690. @cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \
  691. mkdir $$name; \
  692. tar -c --exclude='*~' -f - $(CSRC) $(HDR) $(MAN1) $(MAN3PCAP_EXPAND) \
  693. $(MAN3PCAP_NOEXPAND) $(MANFILE) $(MANMISC) $(EXTRA_DIST) | \
  694. (cd $$name; tar xf -); \
  695. tar -c -z -f $$name.tar.gz $$name; \
  696. rm -rf $$name
  697. depend: $(GENSRC) $(GENHDR)
  698. $(MKDEP) -c "$(CC)" -m "$(DEPENDENCY_CFLAG)" $(CFLAGS) $(DEFS) $(INCLS) $(SRC)
  699. cd rpcapd; $(MAKE) depend
  700. cd testprogs; $(MAKE) depend