summaryrefslogtreecommitdiff
path: root/Makefile
AgeCommit message (Collapse)AuthorFilesLines
2014-09-01netsniff-ng 0.5.9-rc4v0.5.9-rc4Tobias Klauser1-1/+1
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2014-08-15build: Add build flag to enable sparse checking of C source filesTobias Klauser1-0/+3
Similar to the 'make C=1' for the Linux kernel, wire up the sparse command for our build system in a similar fashion. Use 'make C=1 [tool]' to check the source files using sparse. Of course, the sparse tool needs to be installed and available in your $PATH for this to work. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2014-08-13netsniff 0.5.9-rc3v0.5.9-rc3Tobias Klauser1-1/+1
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2014-06-16netsniff-ng 0.5.9-rc2v0.5.9-rc2Tobias Klauser1-1/+1
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2014-06-12netsniff-ng 0.5.9-rc1v0.5.9-rc1Tobias Klauser1-3/+3
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2014-04-30build: Do not add PREFIX to ETCDIRKartik Mistry1-1/+1
This will fix issue of installation of configuration files to /usr/local/etc (or /usr/etc for distribution builds) instead of /etc. [tklauser: extended description a bit] Signed-off-by: Kartik Mistry <kartik.mistry@gmail.com>
2014-04-29netsniff-ng 0.5.8v0.5.8Tobias Klauser1-1/+1
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2014-04-22conf: Use configuration file path from Makefile instead of hardcoded pathsTobias Klauser1-1/+1
Currently, the path to the configuration files is hardcoded to $PREFIX/etc/netsniff-ng. If we want to keep the configuration files outside of prefix (e.g. during development), we need to pass the complete path as specified in $ETCDIRE (and $ETCDIR respectively, which could e.g. be overriden on the command line during build install) as a preprocessor define. This way, we can e.g. install the configuration files to /etc while installing the binaries in /usr/local with: $ make PREFIX=/usr/local ETCDIR=/etc $ make PREFIX=/usr/local ETCDIR=/etc install Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2014-04-12build: fixed PREFIX usageChristian Wiese1-4/+4
This change fixes the use of PREFIX by not hard wiring /usr into the path. Besides that if no PREFIX is provided by the user, it is set to /usr/local now which is considered to be the right location for most LSB conforming distros if the user is compiling from sources to not interfere with the package management for binary packages which are build using /usr as prefix in most of the cases. current behavior without setting PREFIX will most likely interfere with most distro package managers when building from source: ------------------------------------------------------------------------ $ sudo make uninstall RM /usr/sbin/netsniff-ng RM /usr/share/man/man8/netsniff-ng.8.gz RM /usr/sbin/trafgen RM /usr/share/man/man8/trafgen.8.gz RM /usr/sbin/astraceroute RM /usr/share/man/man8/astraceroute.8.gz RM /usr/sbin/ifpps RM /usr/share/man/man8/ifpps.8.gz RM /usr/sbin/bpfc RM /usr/share/man/man8/bpfc.8.gz RM /usr/sbin/curvetun RM /usr/share/man/man8/curvetun.8.gz ------------------------------------------------------------------------ current behavior when setting PREFIX=/usr/local looks kind of weird because of the hard wired /usr: ------------------------------------------------------------------------ $ sudo make PREFIX=/usr/local uninstall RM /usr/local/usr/sbin/netsniff-ng RM /usr/local/usr/share/man/man8/netsniff-ng.8.gz RM /usr/local/usr/sbin/trafgen RM /usr/local/usr/share/man/man8/trafgen.8.gz RM /usr/local/usr/sbin/astraceroute RM /usr/local/usr/share/man/man8/astraceroute.8.gz RM /usr/local/usr/sbin/ifpps RM /usr/local/usr/share/man/man8/ifpps.8.gz RM /usr/local/usr/sbin/bpfc RM /usr/local/usr/share/man/man8/bpfc.8.gz RM /usr/local/usr/sbin/curvetun RM /usr/local/usr/share/man/man8/curvetun.8.gz ------------------------------------------------------------------------ using the proposed fix without setting PREFIX: ------------------------------------------------------------------------ $ sudo make uninstall RM /usr/local/sbin/netsniff-ng RM /usr/local/share/man/man8/netsniff-ng.8.gz RM /usr/local/sbin/trafgen RM /usr/local/share/man/man8/trafgen.8.gz RM /usr/local/sbin/astraceroute RM /usr/local/share/man/man8/astraceroute.8.gz RM /usr/local/sbin/ifpps RM /usr/local/share/man/man8/ifpps.8.gz RM /usr/local/sbin/bpfc RM /usr/local/share/man/man8/bpfc.8.gz RM /usr/local/sbin/curvetun RM /usr/local/share/man/man8/curvetun.8.gz ------------------------------------------------------------------------ Signed-off-by: Christian Wiese <chris@opensde.org> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2014-04-10build: add DESTDIR supportChristian Wiese1-0/+4
This change implements support for specifying an alternative installation destination directory by setting DESTDIR when calling 'make install'. Example: make DESTDIR=/alternative-rootfs install It is particularly useful when cross-compiling and installing in a dedicated directory where for example the rootfs or a build sandbox for the target architecture is mounted. By using DESTDIR you can avoid to mess with PREFIX to include the alternative installation directory! Signed-off-by: Christian Wiese <chris@opensde.org> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-12-23netsniff-ng 0.5.8-rc5v0.5.8-rc5Tobias Klauser1-1/+1
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-10-07netsniff-ng 0.5.8-rc4v0.5.8-rc4Tobias Klauser1-1/+1
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-21netsniff-ng 0.5.8-rc3v0.5.8-rc3Tobias Klauser1-1/+1
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-12build: Add Makefile target for Coverity scannerTobias Klauser1-0/+3
Add a Makefile target to build and upload a snapshot of netsniff-ng to the Coverity scanner. The variables COV_EMAIL and COV_PASSWD need to be set accordingly: make coverity COV_EMAIL=tklauser@distanz.ch COV_PASSWD=... Currently the sub-make which is part of the cov-built call issues warnings about undefined variables from the template. This can be ignored, the build works just fine. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-08-05build: prevent redefinition of _FORTIFY_SOURCE in gentooDaniel Borkmann1-1/+1
Add a -U_FORTIFY_SOURCE in HARDENING=1 [1] to prevent [2], e.g. as in: x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -std=gnu99 -pipe -fPIE -pie -Wl,-z,relro,-z,now -fstack-protector-all -Wstack-protector --param=ssp-buffer-size=4 -ftrapv -D_FORTIFY_SOURCE=2 -fexceptions -fomit-frame-pointer -fno-strict-aliasing -fasynchronous-unwind-tables -fno-delete-null-pointer-checks -D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DVERSION_STRING=\""0.5.8-rc2"""\" -DVERSION_LONG=\""0.5.8-rc2"" (Ziggomatic)"\" -DPREFIX_STRING=\"\" -Wall -I. -I/usr/include/libnl3 -I/usr/include/libnl3 -DHAVE_DISSECTOR_PROTOS -DNEED_TCPDUMP_LIKE_FILTER -I/usr/include/libnl3 -I/usr/include/libnl3 -DHAVE_DISSECTOR_PROTOS -DNEED_TCPDUMP_LIKE_FILTER -o netsniff-ng/proto_igmp.o -c proto_igmp.c :0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default] proto_igmp.c:1:0: note: this is the location of the previous definition [1] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-analyzer/netsniff-ng/files/netsniff-ng-0.5.8-fortify_source.patch?revision=1.1&view=markup [2] http://b-4.xmw.de/var/log/portage/build/net-analyzer/netsniff-ng-0.5.8_rc2:20130805-070734.log Reported-by: Michael Weber <michael@xmw.de> Suggested-by: Michael Weber <michael@xmw.de> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-08-02build: split CFLAGS_DEF and always add CFLAGS_MINDaniel Borkmann1-8/+9
Currently, when doing a custom "make CFLAGS=...", we run into a compile error as several necessary defines are not set. Therefore, use override to always set those. Reported-by: Marco Belmonte <mbelmonte@globalmedia.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-31netsniff-ng 0.5.8-rc2v0.5.8-rc2Daniel Borkmann1-1/+1
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-30build: reduce Extra contents to bare minimumDaniel Borkmann1-2/+0
Improve the build system, so that configuration files are installed per tool basis. Also, introduce post_install targets, so that config files can be altered in some way, e.g. done by trafgen. Moreover, move custom targets from Extra to tool-specific Makefiles. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-30build: Don't uninstall configuration filesTobias Klauser1-1/+0
Several of the tools install/uninstall files from $NCONF_FILES, however if we call the uninstall target for a specific tool (e.g. `make astraceroute_uninstall') but other tools depending on one or more of the config files are still installed, the file is still removed unconditionally. As it would require quite some logic in the Makefile in order to detect installed tools and their dependencies, we just don't uninstall the configuration files anymore. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-29build: use VERSION_SHORT instead of VERSION_STRINGDaniel Borkmann1-2/+3
We have recently changed VERSION_STRING to append CONFIG_RC at the end of the string. Thus, for the build system, change it to VERSION_SHORT where needed, e.g. in release targets where the "+" appendix is not wished. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-24build: minor: align 'bold' cmd to the same column as 'normal'Daniel Borkmann1-1/+1
Just a minor whitespace alignment, nothing else. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-24build: add "+" version appendix automatically during buildDaniel Borkmann1-3/+3
For each build that has no tag name (thus for all commits except releases), we add a "+" version appendix to indicate that it is further than the rc tag itself, like in the kernel. Do this during configure automatically. This is useful in case someone wants to package a relase, so that the full version name indicates that. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-24build: split build system into smaller manageable piecesDaniel Borkmann1-225/+25
Split the build system into smaller manageable pieces, grouped by context. In that sense, we can keep the most important information within the Makefile itself, and group out misc bits and pieces that we just include into it. E.g. 'Cmds' contains all defined commands that we call from other locations, 'Template' contains the generic build template for all tools, 'Extra' has pieces that need special treatment for the tools to build and 'Misc' contains help and release code. This makes it more manageable on the long run. While at it, I also simplified some code and removed all Wflags expect "-Wall" as we want to convert into "-Wall -Wextra -W" anyway. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-23build: move trafgen_stddef.h to stddef.hDaniel Borkmann1-1/+1
Lets just move it instead of symlink as there is no concrete need for it. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-15configure: silent complaint if not built on git repositoryDaniel Borkmann1-1/+1
This silences a complaint if the toolkit is not built within a Git repository: ... [*] Checking libnet ... [YES] fatal: Not a git repository (or any of the parent directories): .git [*] Generating config.h ... [*] Looks good! All tools will be built! This is not problematic as the build can be done without any problems. It will just have an empty Git id in --version output. So simply silence this complaint and move on. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-15netsniff-ng 0.5.8-rc1v0.5.8-rc1Daniel Borkmann1-1/+1
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-13make: put newline after Git peopleDaniel Borkmann1-1/+1
Place a newline after GIT_PEOPLE in the mail announcement target. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-13build: use git describe --alwaysDaniel Borkmann1-1/+1
Use git describe --always in the Makefile instead of git describe as it can fail otherwise. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-11configure: Redirect pkg-config errors to log fileTobias Klauser1-0/+1
If pkg-config doesn't find a library it prints an error to stderr. Instead of directly printing them as part of the configure output, redirect them to config.log and let the user know about it in case there are any messages. Suggested-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-11build: refactor tool specific flags into <tool>/MakefileDaniel Borkmann1-9/+4
To get the normal Makefile a bit cleaner, push the tool specific build options into <tool>/Makefile. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-11build: for an -rc release exclude curvetun for nowDaniel Borkmann1-2/+8
As curvetun needs to undergo some major cleanups, we exclude it from the main build process for the moment until we have fixed all of it in a non-rc release. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-11make: help: consolidate <toolnames> to <tool>Daniel Borkmann1-4/+4
In some part of the help text, we speak about <toolnames> in some other <toolname>. Lets consolidate this to <tool> to avoid any possible confusion. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-09configure: fix multiple issues in build configurationDaniel Borkmann1-10/+1
This patch is a bundle of multiple fixes. 1) Fix compilation of astraceroute when HAVE_LIBPCAP=1: astraceroute doesn't need libpcap, so add an additional guard/define to bpf.h and bpf_comp.c and netsniff-ng.c. Also since we generate a config.h file, we do not need to have this additional compile flag anymore. 2) Fix tstamping.{h,c} to use the configure script instead of the Makefile. For doing this, also fix the object inclusion in netsniff-ng/Makefile. Last but not least, rename __WITH_... into HAVE_... as this is more clean. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-09configure: let configure script generate config.h fileDaniel Borkmann1-0/+1
While we're at it, also let configure script generate the config.h file. The generation of it is currently quite static, but that could change in future. While at it, we also generate a GITVERSION define, that we will use for ``--version'' output of the individual tools for being able to provide better support since we can see what concrete commit people are using when building from Git repo. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-08configure: netsniff-ng: libpcap is not a hard dependencyDaniel Borkmann1-1/+7
netsniff-ng uses libpcap only for high-level filter compiling. Thus, let netsniff-ng not "hard-depend" on libpcap, but rather disable filter compiling in case the user does not want to install libpcap. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-08configure: make: misc: update header commentDaniel Borkmann1-0/+1
Add a header comment to the configure script with Tobias as the primary author, and also mention Tobias as an author in the Makefile itself for his changes. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-07-08configure, Makefile: Conditionally build toolsTobias Klauser1-0/+1
Instead of halting out the entire build build if one dependency is not available, only exclude the tools that link against it from building. The configure script will now print a list of all tools that will be built -- and in case some libaries are not available -- that will not be built. Also add checks for libcli and libnet which mausezahn depends on. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-05Makefile, INSTALL: Simplify clean/uninstall Makefile targetsTobias Klauser1-20/+23
Streamline the Makfile targets by separating the clean targets (which only affect the build tree) from the uninstall targets (affecting files installed in the system). Do this by renaming the 'distclean' target to 'uninstall' and removing unnecessary aliases. The 'distclean' target serves now as a way to remove build files and Config. The 'mrproper' will bring the source into a pristine state as checked out from git. Summary of the new/changed targets: clean: remove all build related files (but not Config) distclean: 'make clean' + remove Config mrproper: remove all files not in git repository uninstall: remove all files installed by us from the system, but not affecting the build environment. %_uninstall: tool specific uninstall The following targets were removed: mostlyclean, realclean and clobber. Also the target names in the INSTALL file are adjusted. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-07-05configure, Makefile: Fail in Makefile if Config is not completeTobias Klauser1-1/+4
Define CONFIG_OK in the Config file generated in the configure script and check for it being defined in the Makefile before attempting anything else. This way we can better inform the user that she needs to run ./configure first. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-28configure: Check for presence of pkg-config and ccache binariesTobias Klauser1-1/+1
Check whether pkg-config and ccache are in the PATH. A missing pkg-config will cause the configure script to abort with an error. The presence of ccache is written to Config and used by the Makefile to conditionally make use of it. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-06-24configure: Add configure script used to detect NaClTobias Klauser1-0/+3
In order to use an installation of NaCl provided by the distro or by previous manual installation, provide a configure script which checks for nacl's presence. Also check of libnl-genl headers. More checks of the other libraries depended on by netsniff-ng as well as checks for necessary kernel headers should be added here too. The configure script is preliminary and has not yet extensively been tested on multiple systems. The concept was inspired by the configure script of trinity and iproute2. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-05-29make: add DISTRO=1 for compilation on distributionsDaniel Borkmann1-6/+9
For packaging, we cannot use -O3, -march etc, so have an option that allows for distribution build and does less tuning. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-29make: allow to append CFLAGS in addition to overwriteDaniel Borkmann1-19/+14
This is needed for distribution packaging purposes. Also remove the warning, because -I/-L paths for nacl could be defined via cmdline as well. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-26make: minor cleanups in MakefileDaniel Borkmann1-6/+14
Remove some unneeded stuff, and move other things around. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-24make: add HARDENING build optionDaniel Borkmann1-8/+17
Add HARDENING=1 build option and move all hardening-related GCC flags into this condition. This allows the user to choose whether or not he wants to have a hardened build with some possible performance tradeoff at load/runtime. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-24make: minor update in cflagsDaniel Borkmann1-4/+5
Add -z relro for linking, move --param ssp-buffer-size=4 to stack protector flag, and more. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-23make: include build nameDaniel Borkmann1-2/+3
Include long version string into tools when called with --version. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-14build: install man pagesDaniel Borkmann1-1/+6
Now that we have some man-pages, let them be installed via normal ``make install'' call. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-14build: remove some unused stuff and clean up a bitDaniel Borkmann1-13/+11
Remove some variables that are unused, but set. Also reorder and comment some other sections. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-05-13staging: add mausezahn staging directoryDaniel Borkmann1-2/+5
After some back and forth, we decided that it is easier to maintain mausezahn in a staging directory until it is fully reworked and cleaned up to be ready to be fully integrated. This way, it is better than having it in a separate branch, and we can also accept patches from outside more easily. Also, while at it, fix up some function mismatches with libcli. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>