summaryrefslogtreecommitdiff
path: root/mk/package.mk
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2009-10-17 19:41:13 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2009-10-17 19:41:13 +0200
commitc008b8741447a77371f3fd487830bfd7952dbdcd (patch)
treed93378254682782dbe0175dcf69edb1fbf65dbe3 /mk/package.mk
parent16b627883cdd2fb2258002b30dfa61c440373e9c (diff)
parent6d26b19269a28ff576e872473cb3b4610a61fceb (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'mk/package.mk')
-rw-r--r--mk/package.mk61
1 files changed, 37 insertions, 24 deletions
diff --git a/mk/package.mk b/mk/package.mk
index c28f22a7c..3f0cc4a7d 100644
--- a/mk/package.mk
+++ b/mk/package.mk
@@ -1,23 +1,33 @@
# This file is part of the OpenADK project. OpenADK is copyrighted
# material, please see the LICENCE file in the top-level directory.
-all: build-all-ipkgs
+all: build-all-pkgs
+TCFLAGS:= ${TARGET_CFLAGS}
+TCXXFLAGS:= ${TARGET_CFLAGS}
+TCPPFLAGS:= ${TARGET_CPPFLAGS}
+TLDFLAGS:= ${TARGET_LDFLAGS} -Wl,-rpath -Wl,/usr/lib \
+ -Wl,-rpath-link -Wl,${STAGING_DIR}/usr/lib \
+ -L${STAGING_DIR}/lib -L${STAGING_DIR}/usr/lib
ifeq ($(ADK_STATIC),y)
TCFLAGS:= ${TARGET_CFLAGS} -static
TCXXFLAGS:= ${TARGET_CFLAGS} -static
TCPPFLAGS:= ${TARGET_CPPFLAGS} -static
-else
-TCFLAGS:= ${TARGET_CFLAGS}
-TCXXFLAGS:= ${TARGET_CFLAGS}
-TCPPFLAGS:= ${TARGET_CPPFLAGS}
+TLDFLAGS:= ${TARGET_LDFLAGS} -Wl,-rpath -Wl,/usr/lib \
+ -Wl,-rpath-link -Wl,${STAGING_DIR}/usr/lib \
+ -L${STAGING_DIR}/lib -L${STAGING_DIR}/usr/lib \
+ -static
endif
+ifeq ($(ADK_NATIVE),y)
+TCFLAGS:=
+TCXXFLAGS:=
+TCPPFLAGS:=
+TLDFLAGS:=
+endif
+
ifeq ($(ADK_DEBUG),)
TCPPFLAGS+= -DNDEBUG
endif
-TLDFLAGS:= ${TARGET_LDFLAGS} -Wl,-rpath -Wl,/usr/lib \
- -Wl,-rpath-link -Wl,${STAGING_DIR}/usr/lib \
- -L${STAGING_DIR}/lib -L${STAGING_DIR}/usr/lib
ifneq ($(ADK_DEBUG),)
CONFIGURE_ARGS+= --enable-debug
else
@@ -30,7 +40,11 @@ CONFIGURE_ARGS+= --disable-ipv6
endif
ifeq ($(ADK_NATIVE),y)
- CONFIG_SHELL='$(strip ${SHELL})'
+CONFIGURE_ENV+= CONFIG_SHELL='$(strip ${SHELL})' \
+ CFLAGS='$(strip ${TCFLAGS})' \
+ CXXFLAGS='$(strip ${TCXXFLAGS})' \
+ CPPFLAGS='$(strip ${TCPPFLAGS})' \
+ LDFLAGS='$(strip ${TLDFLAGS})'
else
CONFIGURE_ENV+= ${TARGET_CONFIGURE_OPTS} \
${HOST_CONFIGURE_OPTS} \
@@ -59,7 +73,11 @@ INSTALL_TARGET?= install
ifeq ($(ADK_NATIVE),y)
MAKE_ENV+= \
WRKDIR='${WRKDIR}' WRKDIST='${WRKDIST}' \
- WRKSRC='${WRKSRC}' WRKBUILD='${WRKBUILD}'
+ WRKSRC='${WRKSRC}' WRKBUILD='${WRKBUILD}' \
+ CFLAGS='$(strip ${TCFLAGS})' \
+ CXXFLAGS='$(strip ${TCXXFLAGS})' \
+ CPPFLAGS='$(strip ${TCPPFLAGS})' \
+ LDFLAGS='$(strip ${TLDFLAGS})'
else
MAKE_ENV+= PATH='${TARGET_PATH}' \
${HOST_CONFIGURE_OPTS} \
@@ -105,7 +123,7 @@ build: ${_BUILD_COOKIE}
fake: ${_FAKE_COOKIE}
# our recursive build entry point
-build-all-ipkgs: ${_IPKGS_COOKIE}
+build-all-pkgs: ${_IPKGS_COOKIE}
# there are some parameters to the PKG_template function
# 1.) Config.in identifier ADK_PACKAGE_$(1)
@@ -122,13 +140,13 @@ build-all-ipkgs: ${_IPKGS_COOKIE}
# cleaning (needed for toolchain packages like glibc/eglibc)
# should be package format independent and modular in the future
define PKG_template
-IPKG_$(1)= $(PACKAGE_DIR)/$(2)_$(3)_${CPU_ARCH}.ipk
-IDIR_$(1)= $(WRKDIR)/fake-${CPU_ARCH}/ipkg-$(2)
+IPKG_$(1)= $(PACKAGE_DIR)/$(2)_$(3)_${CPU_ARCH}.${PKG_SUFFIX}
+IDIR_$(1)= $(WRKDIR)/fake-${CPU_ARCH}/pkg-$(2)
ifneq (${ADK_PACKAGE_$(1)}${DEVELOPER},)
ALL_IPKGS+= $$(IPKG_$(1))
ALL_IDIRS+= $${IDIR_$(1)}
endif
-INFO_$(1)= $(IPKG_STATE_DIR)/info/$(2).list
+INFO_$(1)= $(PKG_STATE_DIR)/info/$(2).list
ifeq ($(ADK_PACKAGE_$(1)),y)
install-targets: $$(INFO_$(1))
@@ -142,7 +160,6 @@ $$(IDIR_$(1))/CONTROL/control: ${_PATCH_COOKIE}
@echo "Package: $(2)" > $(WRKDIR)/.$(2).control
@echo "Section: $(6)" >> $(WRKDIR)/.$(2).control
@echo "Description: $(5)" >> $(WRKDIR)/.$(2).control
-ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
${BASH} ${SCRIPT_DIR}/make-ipkg-dir.sh $${IDIR_$(1)} $${ICONTROL_$(1)} $(3) ${CPU_ARCH}
@adeps='$$(strip $${IDEPEND_$(1)})'; if [[ -n $$$$adeps ]]; then \
comma=; \
@@ -162,7 +179,6 @@ ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
@for file in conffiles preinst postinst prerm postrm; do \
[ ! -f ./files/$(2).$$$$file ] || cp ./files/$(2).$$$$file $$(IDIR_$(1))/CONTROL/$$$$file; \
done
-endif
$$(IPKG_$(1)): $$(IDIR_$(1))/CONTROL/control $${_FAKE_COOKIE}
ifeq ($(ADK_DEBUG),)
@@ -196,7 +212,7 @@ endif
'ramdisk location:' >&2; \
echo "$$$$x" | sed 's/^/- /' >&2; \
fi; \
- if [ "${PKG_NAME}" != "uClibc" -a "${PKG_NAME}" != "glibc" -a "${PKG_NAME}" != "libpthread" -a "${PKG_NAME}" != "libstdcxx" -a "${PKG_NAME}" != "libthread-db" ];then \
+ if [ "${PKG_NAME}" != "uClibc" -a "${PKG_NAME}" != "glibc" -a "${PKG_NAME}" != "eglibc" -a "${PKG_NAME}" != "libpthread" -a "${PKG_NAME}" != "libstdcxx" -a "${PKG_NAME}" != "libthread-db" ];then \
find lib \( -name lib\*.so\* -o -name lib\*.a \) \
-exec echo 'WARNING: $${IPKG_$(1)} installs files in /lib -' \
' fix this!' >&2 \; -quit 2>/dev/null; fi; \
@@ -220,11 +236,8 @@ ifeq (,$(filter noscripts,$(7)))
>>'$${STAGING_PARENT}/pkg/$(1)'; \
done
endif
-ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
- $${IPKG_BUILD} $${IDIR_$(1)} $${PACKAGE_DIR} $(MAKE_TRACE)
-endif
-ifeq ($(ADK_TARGET_PACKAGE_TGZ),y)
- (cd $${IDIR_$(1)} && tar czf $(PACKAGE_DIR)/$(2)_$(3)_${CPU_ARCH}.tar.gz .);
+ifeq (,$(filter libonly,$(7)))
+ $${PKG_BUILD} $${IDIR_$(1)} $${PACKAGE_DIR} $(MAKE_TRACE)
endif
clean-targets: clean-dev-$(1)
@@ -241,7 +254,7 @@ endif
@rm -f '$${STAGING_PARENT}/pkg/$(1)'
$$(INFO_$(1)): $$(IPKG_$(1))
- $(IPKG) install $$(IPKG_$(1))
+ $(PKG_INSTALL) $$(IPKG_$(1))
endef
install-targets:
@@ -259,4 +272,4 @@ distclean: clean
rm -f ${FULLDISTFILES}
.PHONY: all refetch extract patch configure \
- build fake package install clean build-all-ipkgs
+ build fake package install clean build-all-pkgs