File: Makefile

package info (click to toggle)
npd6 1.1.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 296 kB
  • sloc: ansic: 2,393; sh: 94; makefile: 80
file content (123 lines) | stat: -rw-r--r-- 3,469 bytes parent folder | download
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#
#   This software is Copyright 2011 by Sean Groarke <sgroarke@gmail.com>
#   All rights reserved.
#
#   This file is part of npd6.
#
#   npd6 is free software: you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   npd6 is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with npd6.  If not, see <http://www.gnu.org/licenses/>.
#

# $Id$
# $HeadURL$

VERSION=1.1.0

CC=gcc
CFLAGS += -Wall -g -O3 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wformat -Werror=format-security
LDFLAGS += -Wl,-z,relro -Wl,-z,now
SOURCES=main.c icmp6.c util.c ip6.c config.c expintf.c exparser.c
OBJECTS=$(SOURCES:.c=.o)
HEADERS=includes.h npd6.h
EXECUTABLE=npd6
INSTALL_PREFIX=/usr
MAN_PREFIX=/usr/share/man
DEBIAN=debian/
TARGZ=npd6-$(VERSION)
#DEV:= -D'BUILDREV="$(VERSION).$(shell svnversion -n .)"'
DEV:= -D'BUILDREV="$(VERSION)"'

all: $(SOURCES) $(EXECUTABLE)

$(EXECUTABLE): $(OBJECTS)
	$(CC) $(LDFLAGS) $(OBJECTS) -o $@

.c.o:
	$(CC) $(CFLAGS) $(DEV) -c $< -o $@

clean:
	rm -rf $(OBJECTS) $(EXECUTABLE)

distclean:
	rm -rf $(OBJECTS) $(EXECUTABLE)
#	rm -rf debian/etc/
#	rm -rf debian/usr/
#	rm -rf debian/DEBIAN/
#	rm -rf debian/npd6/
#	rm -rf debian/files
#	rm -rf debian/npd6.*
#	rm -f npd6*.deb

install: all
	mkdir -p $(DESTDIR)/etc/init.d/
	mkdir -p $(DESTDIR)$(INSTALL_PREFIX)/bin/
	mkdir -p $(DESTDIR)$(MAN_PREFIX)/man5/
	mkdir -p $(DESTDIR)$(MAN_PREFIX)/man8/
	cp etc/npd6 $(DESTDIR)/etc/init.d/npd6
	cp etc/npd6.conf.sample $(DESTDIR)/etc/npd6.conf.sample
	cp npd6 $(DESTDIR)$(INSTALL_PREFIX)/bin/
	#cp man/npd6.conf.5.gz $(DESTDIR)$(MAN_PREFIX)/man5/
	#cp man/npd6.8.gz $(DESTDIR)$(MAN_PREFIX)/man8/

ubuntu: all
	mkdir $(DEBIAN)/DEBIAN/
	cp $(DEBIAN)/c* $(DEBIAN)/DEBIAN/
	mkdir -p $(DEBIAN)/etc/init.d/
	mkdir -p $(DEBIAN)$(INSTALL_PREFIX)/bin/
	mkdir -p $(DEBIAN)$(MAN_PREFIX)/man5/
	mkdir -p $(DEBIAN)$(MAN_PREFIX)/man8/
	cp etc/npd6 $(DEBIAN)/etc/init.d/npd6
	cp etc/npd6.conf.sample $(DEBIAN)/etc/npd6.conf.sample
	cp npd6 $(DEBIAN)$(INSTALL_PREFIX)/bin/
	cp man/npd6.conf.5.gz $(DEBIAN)$(MAN_PREFIX)/man5/
	cp man/npd6.8.gz $(DEBIAN)$(MAN_PREFIX)/man8/
	debuild -S -k93C35BB8


debian: all
	mkdir $(DEBIAN)/DEBIAN/
	cp $(DEBIAN)/c* $(DEBIAN)/DEBIAN/
	mkdir -p $(DEBIAN)/etc/init.d/
	mkdir -p $(DEBIAN)$(INSTALL_PREFIX)/bin/
	mkdir -p $(DEBIAN)$(MAN_PREFIX)/man5/
	mkdir -p $(DEBIAN)$(MAN_PREFIX)/man8/
	cp etc/npd6 $(DEBIAN)/etc/init.d/npd6
	cp etc/npd6.conf.sample $(DEBIAN)/etc/npd6.conf.sample
	cp npd6 $(DEBIAN)$(INSTALL_PREFIX)/bin/
	cp man/npd6.conf.5.gz $(DEBIAN)$(MAN_PREFIX)/man5/
	cp man/npd6.8.gz $(DEBIAN)$(MAN_PREFIX)/man8/
	debuild -I -us -uc 

debchange:
	dch -v $(VERSION) $(change)

debrelease:
	dch --release -M

targz:
	mkdir ../$(TARGZ)
	mkdir ../$(TARGZ)/man
	mkdir ../$(TARGZ)/etc
	mkdir ../$(TARGZ)/debian
	cp man/* ../$(TARGZ)/man
	cp etc/* ../$(TARGZ)/etc
	cp *.c ../$(TARGZ)/
	cp *.h ../$(TARGZ)/
	cp INSTALL ../$(TARGZ)
	cp debian/c* ../$(TARGZ)/debian
	cp debian/rules ../$(TARGZ)/debian
	cp Makefile ../$(TARGZ)/
	tar -cvf ../$(TARGZ).tar ../$(TARGZ)/*
	gzip ../$(TARGZ).tar
	rm -r ../$(TARGZ)/