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
RevLine 
[c2e2d0c]1# $FreeWRT$
[3f0223f]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.
[c2e2d0c]6
[53c89c6]7include $(TOPDIR)/rules.mk
8
9WRKBUILD= $(TOOLS_BUILD_DIR)/paxmirabilis
10
[909c4ae]11OUR_FLAGS= -I${TOPDIR}/scripts \
12 -include ${TOPDIR}/scripts/param.h
13
[32a1465]14ifeq ($(OStype),Linux)
[a6cd888]15OUR_FLAGS+= -DLONG_OFF_T \
16 -D_STRLCPY_DEFNS
17SRCS+= strlfun.c \
18 strmode.c \
19 fgetln.c
[32a1465]20endif
21
[6bcf6ae]22SRCS+= \
[a569125]23 src/ar.c \
[3c89b8a]24 src/ar_io.c \
[53c89c6]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
[c2e2d0c]46 mkdir -p $(STAGING_DIR)/bin
[5eac833]47 -rm -f $(STAGING_DIR)/bin/{pax,cpio,tar} \
48 ${TOPDIR}/lbin/{,mir}{pax,cpio,tar}
[c2e2d0c]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
[006f3d5]52 cd ${TOPDIR}/lbin && ln pax cpio && ln pax tar
[c41ecbb]53 cd ${TOPDIR}/lbin && ln pax mircpio && ln pax mirpax && ln pax mirtar
[006f3d5]54
[c2e2d0c]55install-lbin:
[5eac833]56 rm -f ${TOPDIR}/lbin/{,mir}{pax,cpio,tar}
[c2e2d0c]57 if [ -e $(STAGING_DIR)/bin/pax ]; then \
58 cp $(STAGING_DIR)/bin/pax ${TOPDIR}/lbin/pax; \
[c41ecbb]59 cd ${TOPDIR}/lbin && ln pax cpio && ln pax tar && \
60 ln pax mircpio && ln pax mirpax && ln pax mirtar; \
[c2e2d0c]61 else \
62 rm -f $(TOOLS_STAMP_DIR)/.tools_paxmirabilis-install; \
63 fi
64
[53c89c6]65package:
[006f3d5]66
[53c89c6]67clean:
[c2e2d0c]68 rm -rf ${WRKBUILD}
[5eac833]69 rm -f $(STAGING_DIR)/bin/{pax,cpio,tar} \
70 ${TOPDIR}/lbin/{,mir}{pax,cpio,tar}
[53c89c6]71
72${WRKBUILD}:
73 mkdir -p ${WRKBUILD}
74
75${WRKBUILD}/pax: ${SRCS}
[a569125]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.