nmdb: Add an option to save the pidfile
[nmdb.git] / utils / Makefile
blobb56f6aecf5bb101048776d8c947fe12fb4653651
2 CFLAGS += -std=c99 -pedantic -Wall -O3
3 ALL_CFLAGS = -D_XOPEN_SOURCE=500 $(CFLAGS)
5 ifdef DEBUG
6 ALL_CFLAGS += -g
7 endif
9 ifdef PROFILE
10 ALL_CFLAGS += -g -pg -fprofile-arcs -ftest-coverage
11 endif
14 # prefix for installing the binaries
15 PREFIX=/usr/local
18 ifneq ($(V), 1)
19 NICE_CC = @echo " CC $@"; $(CC)
20 else
21 NICE_CC = $(CC)
22 endif
25 default: all
27 all: nmdb-stats
29 nmdb-stats: nmdb-stats.o
30 $(NICE_CC) $(ALL_CFLAGS) -L../libnmdb -lnmdb nmdb-stats.o \
31 -o nmdb-stats
33 .c.o:
34 $(NICE_CC) $(ALL_CFLAGS) -I../libnmdb -c $< -o $@
36 install-bin: nmdb-stats
37 install -d $(PREFIX)/bin
38 install -m 0755 nmdb-stats $(PREFIX)/bin
40 install-man:
41 install -d $(PREFIX)/man/man1
42 install -m 0644 nmdb-stats.1 $(PREFIX)/man/man1/
44 install: install-bin install-man
46 clean:
47 rm -f nmdb-stats.o nmdb-stats
48 rm -f *.bb *.bbg *.da *.gcov *.gcda *.gcno gmon.out
50 .PHONY: default all clean install-bin install-man install