2 # Copyright (C) 2006 Greg Kroah-Hartman <greg@kroah.com>
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; version 2 of the License.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
33 CC = $(CROSS_COMPILE)gcc
34 LD = $(CROSS_COMPILE)gcc
35 AR = $(CROSS_COMPILE)ar
37 override CFLAGS += -g -Wall -pipe -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -O2
39 WARNINGS = -Wstrict-prototypes -Wsign-compare -Wshadow \
40 -Wchar-subscripts -Wmissing-declarations -Wnested-externs \
41 -Wpointer-arith -Wcast-align -Wsign-compare -Wmissing-prototypes
43 LDFLAGS += -Wl,-warn-common,--as-needed
56 # We need -lcurl for the curl stuff
57 # We need -lsocket and -lnsl when on Solaris
58 # We need -lssl and -lcrypto when using libcurl with SSL support
59 # We need -lpthread for the pthread example
60 #LIB_OBJS = -lcurl -lnsl -lssl -lcrypto
61 LIB_OBJS = -lcurl -lnsl
63 all: $(PROGRAM) $(MAN_PAGES)
65 # "Static Pattern Rule" to build all programs
66 bti: %: $(HEADERS) $(GEN_HEADERS) $(CORE_OBJS)
68 $(Q) $(LD) $(LDFLAGS) $(CORE_OBJS) -o $@ $(LIB_OBJS)
72 %.o: %.c $(HEADERS) $(GEN_HEADERS)
74 $(Q) $(CC) -c $(CFLAGS) $< -o $@
79 $(Q) echo "/* Generated by make. */" > $@
80 $(Q) echo \#define BTI_VERSION \"$(VERSION)\" >> $@
91 $(Q) - find . -type f -name '*.orig' -print0 | xargs -0r rm -f
92 $(Q) - find . -type f -name '*.rej' -print0 | xargs -0r rm -f
93 $(Q) - find . -type f -name '*~' -print0 | xargs -0r rm -f
94 $(Q) - find . -type f -name '*.[oas]' -print0 | xargs -0r rm -f
95 $(Q) - find . -type f -name "*.gcno" -print0 | xargs -0r rm -f
96 $(Q) - find . -type f -name "*.gcda" -print0 | xargs -0r rm -f
97 $(Q) - find . -type f -name "*.gcov" -print0 | xargs -0r rm -f
98 $(Q) - rm -f core $(PROGRAM) $(GEN_HEADERS)
102 $(Q) - rm -f bti-$(VERSION).tar.gz
103 head -1 ChangeLog | grep -q "to v$(VERSION)"
104 head -1 RELEASE-NOTES | grep -q "bti $(VERSION)"
105 git commit -a -m "release $(VERSION)"
106 cat .git/refs/heads/master > .git/refs/tags/$(VERSION)
108 git archive --format=tar --prefix=bti-$(VERSION)/ HEAD | gzip -9v > bti-$(VERSION).tar.gz