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 XML2_CFLAGS = `xml2-config --cflags`
38 override CFLAGS += -g -Wall -pipe -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -O2 $(XML2_CFLAGS)
40 WARNINGS = -Wstrict-prototypes -Wsign-compare -Wshadow \
41 -Wchar-subscripts -Wmissing-declarations -Wnested-externs \
42 -Wpointer-arith -Wcast-align -Wsign-compare -Wmissing-prototypes
44 LDFLAGS += -Wl,-warn-common,--as-needed
50 INSTALL_BIN = ${INSTALL} -m 0755 -t ${DEST}${PREFIX}/bin
51 INSTALL_MAN = ${INSTALL} -m 0644 -t ${DEST}${PREFIX}/share/man
63 # We need -lcurl for the curl stuff
64 # We need -lsocket and -lnsl when on Solaris
65 # We need -lreadline for readline support
66 # We need -lssl and -lcrypto when using libcurl with SSL support
67 # We need -lpthread for the pthread example
68 #LIB_OBJS = -lcurl -lnsl -lssl -lcrypto
69 LIB_OBJS = -lcurl -lnsl -lreadline
70 LIB_XML2 = `xml2-config --libs`
72 all: $(PROGRAM) $(MAN_PAGES)
74 # "Static Pattern Rule" to build all programs
75 bti: %: $(HEADERS) $(GEN_HEADERS) $(CORE_OBJS)
77 $(Q) $(LD) $(LDFLAGS) $(CORE_OBJS) -o $@ $(LIB_OBJS) $(LIB_XML2)
81 %.o: %.c $(HEADERS) $(GEN_HEADERS)
83 $(Q) $(CC) -c $(CFLAGS) $< -o $@
86 bti_version.h: Makefile
88 $(Q) echo "/* Generated by make. */" > $@
89 $(Q) echo \#define BTI_VERSION \"$(VERSION)\" >> $@
100 $(Q) - find . -type f -name '*.orig' -print0 | xargs -0r rm -f
101 $(Q) - find . -type f -name '*.rej' -print0 | xargs -0r rm -f
102 $(Q) - find . -type f -name '*~' -print0 | xargs -0r rm -f
103 $(Q) - find . -type f -name '*.[oas]' -print0 | xargs -0r rm -f
104 $(Q) - find . -type f -name "*.gcno" -print0 | xargs -0r rm -f
105 $(Q) - find . -type f -name "*.gcda" -print0 | xargs -0r rm -f
106 $(Q) - find . -type f -name "*.gcov" -print0 | xargs -0r rm -f
107 $(Q) - rm -f core $(PROGRAM) $(GEN_HEADERS)
111 $(Q) - rm -f bti-$(VERSION).tar.gz
112 head -1 ChangeLog | grep -q "to v$(VERSION)"
113 head -1 RELEASE-NOTES | grep -q "bti $(VERSION)"
114 git commit -a -m "release $(VERSION)"
115 cat .git/refs/heads/master > .git/refs/tags/$(VERSION)
117 git archive --format=tar --prefix=bti-$(VERSION)/ HEAD | gzip -9v > bti-$(VERSION).tar.gz
121 $(E) " INSTALL " ${DEST}${PREFIX}
122 ${Q} ${INSTALL_BIN} ${PROGRAM}
123 ${Q} ${INSTALL_MAN} ${MAN_PAGES}