| [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] | 7 | include $(TOPDIR)/rules.mk
|
|---|
| 8 |
|
|---|
| 9 | WRKBUILD= $(TOOLS_BUILD_DIR)/paxmirabilis
|
|---|
| 10 |
|
|---|
| [909c4ae] | 11 | OUR_FLAGS= -I${TOPDIR}/scripts \
|
|---|
| 12 | -include ${TOPDIR}/scripts/param.h
|
|---|
| 13 |
|
|---|
| [32a1465] | 14 | ifeq ($(OStype),Linux)
|
|---|
| [a6cd888] | 15 | OUR_FLAGS+= -DLONG_OFF_T \
|
|---|
| 16 | -D_STRLCPY_DEFNS
|
|---|
| 17 | SRCS+= strlfun.c \
|
|---|
| 18 | strmode.c \
|
|---|
| 19 | fgetln.c
|
|---|
| [32a1465] | 20 | endif
|
|---|
| 21 |
|
|---|
| [6bcf6ae] | 22 | SRCS+= \
|
|---|
| [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 |
|
|---|
| 41 | prepare: ${WRKBUILD}
|
|---|
| 42 |
|
|---|
| 43 | compile: prepare ${WRKBUILD}/pax
|
|---|
| 44 |
|
|---|
| 45 | install: 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] | 55 | install-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] | 65 | package:
|
|---|
| [006f3d5] | 66 |
|
|---|
| [53c89c6] | 67 | clean:
|
|---|
| [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
|
|---|