root/trunk/freewrt/tools/paxmirabilis/Makefile

Revision 3980, 1.9 kB (checked in by tg, 3 months ago)

new upstream release paxmirabilis-20120216
• better kfreebsd-gnu support
• use more standards-like things (long long instead of quad_t)
• compile time assertion to check whether off_t is correct
• cpio now supports -V GNU extension
also, build this with LTO if ${HOSTCC} supports it, like in Debian

  • Property svn:keywords set to FreeWRT=Id
Line 
1 # $FreeWRT$
2 #-
3 # This file is part of the FreeWRT project. FreeWRT is copyrighted
4 # material, please see the LICENCE file in the top-level directory
5 # or at http://www.freewrt.org/licence for details.
6
7 include $(TOPDIR)/rules.mk
8
9 WRKBUILD=       $(TOOLS_BUILD_DIR)/paxmirabilis
10
11 OUR_FLAGS=      -I${TOPDIR}/scripts \
12                 -include ${TOPDIR}/scripts/param.h
13
14 ifeq ($(OStype),Linux)
15 OUR_FLAGS+=     -DLONG_OFF_T \
16                 -D_STRLCPY_DEFNS
17 SRCS+=          strlfun.c \
18                 strmode.c \
19                 fgetln.c
20 endif
21
22 SRCS+=          \
23                 src/ar.c \
24                 src/ar_io.c \
25                 src/ar_subs.c \
26                 src/buf_subs.c \
27                 src/cache.c \
28                 src/cpio.c \
29                 src/file_subs.c \
30                 src/ftree.c \
31                 src/gen_subs.c \
32                 src/getoldopt.c \
33                 src/options.c \
34                 src/pat_rep.c \
35                 src/pax.c \
36                 src/sel_subs.c \
37                 src/tables.c \
38                 src/tar.c \
39                 src/tty_subs.c
40
41 prepare: ${WRKBUILD}
42
43 compile: prepare ${WRKBUILD}/pax
44
45 install:
46         mkdir -p $(STAGING_TOOLS)/bin
47         -rm -f $(STAGING_TOOLS)/bin/{pax,cpio,tar} \
48             ${TOPDIR}/lbin/{,mir}{pax,cpio,tar}
49         install -c -s -m 555 ${WRKBUILD}/pax $(STAGING_TOOLS)/bin/pax
50         cd ${STAGING_TOOLS}/bin && ln pax cpio && ln pax tar
51         cp $(STAGING_TOOLS)/bin/pax ${TOPDIR}/lbin/pax
52         cd ${TOPDIR}/lbin && ln pax cpio && ln pax tar
53         cd ${TOPDIR}/lbin && ln pax mircpio && ln pax mirpax && ln pax mirtar
54
55 install-lbin:
56         rm -f ${TOPDIR}/lbin/{,mir}{pax,cpio,tar}
57         if [ -e $(STAGING_TOOLS)/bin/pax ]; then \
58                 cp $(STAGING_TOOLS)/bin/pax ${TOPDIR}/lbin/pax; \
59                 cd ${TOPDIR}/lbin && ln pax cpio && ln pax tar && \
60                     ln pax mircpio && ln pax mirpax && ln pax mirtar; \
61         fi
62
63 package:
64
65 clean:
66         rm -rf ${WRKBUILD}
67         rm -f $(STAGING_TOOLS)/bin/{pax,cpio,tar} \
68             ${TOPDIR}/lbin/{,mir}{pax,cpio,tar}
69
70 ${WRKBUILD}:
71         mkdir -p ${WRKBUILD}
72
73 ${WRKBUILD}/pax: ${SRCS}
74         rm -f $@
75         +for opts in '-flto=jobserver' '-fwhole-program --combine' ''; do \
76                 set -x; \
77                 ${HOSTCC} ${HOSTCFLAGS} $$opts -Isrc ${OUR_FLAGS} -o $@ $^; \
78                 test -x $@ && exit 0; \
79         done; echo >&2 Compiling failed.; exit 1
Note: See TracBrowser for help on using the browser.