source: freewrt/tools/paxmirabilis/Makefile@ a569125

freewrt_1_0 freewrt_2_0
Last change on this file since a569125 was a569125, checked in by Thorsten Glaser <tg@…>, 14 years ago

even FreeWRT 1.0-stable deserves paxmirabilis-20120216 compiled with LTO ☺

git-svn-id: svn://www.freewrt.org/branches/freewrt_1_0@3981 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 1.9 KB
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
7include $(TOPDIR)/rules.mk
8
9WRKBUILD= $(TOOLS_BUILD_DIR)/paxmirabilis
10
11OUR_FLAGS= -I${TOPDIR}/scripts \
12 -include ${TOPDIR}/scripts/param.h
13
14ifeq ($(OStype),Linux)
15OUR_FLAGS+= -DLONG_OFF_T \
16 -D_STRLCPY_DEFNS
17SRCS+= strlfun.c \
18 strmode.c \
19 fgetln.c
20endif
21
22SRCS+= \
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
41prepare: ${WRKBUILD}
42
43compile: prepare ${WRKBUILD}/pax
44
45install: compile
46 mkdir -p $(STAGING_DIR)/bin
47 -rm -f $(STAGING_DIR)/bin/{pax,cpio,tar} \
48 ${TOPDIR}/lbin/{,mir}{pax,cpio,tar}
49 install -c -s -m 555 ${WRKBUILD}/pax $(STAGING_DIR)/bin/pax
50 cd ${STAGING_DIR}/bin && ln pax cpio && ln pax tar
51 cp $(STAGING_DIR)/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
55install-lbin:
56 rm -f ${TOPDIR}/lbin/{,mir}{pax,cpio,tar}
57 if [ -e $(STAGING_DIR)/bin/pax ]; then \
58 cp $(STAGING_DIR)/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 else \
62 rm -f $(TOOLS_STAMP_DIR)/.tools_paxmirabilis-install; \
63 fi
64
65package:
66
67clean:
68 rm -rf ${WRKBUILD}
69 rm -f $(STAGING_DIR)/bin/{pax,cpio,tar} \
70 ${TOPDIR}/lbin/{,mir}{pax,cpio,tar}
71
72${WRKBUILD}:
73 mkdir -p ${WRKBUILD}
74
75${WRKBUILD}/pax: ${SRCS}
76 rm -f $@
77 +for opts in '-flto=jobserver' '-fwhole-program --combine' ''; do \
78 set -x; \
79 ${HOSTCC} ${HOSTCFLAGS} $$opts -Isrc ${OUR_FLAGS} -o $@ $^; \
80 test -x $@ && exit 0; \
81 done; echo >&2 Compiling failed.; exit 1
Note: See TracBrowser for help on using the repository browser.