summaryrefslogtreecommitdiff
path: root/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
parent16b627883cdd2fb2258002b30dfa61c440373e9c (diff)
parent6d26b19269a28ff576e872473cb3b4610a61fceb (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'mk')
-rw-r--r--mk/build.mk13
-rw-r--r--mk/buildhlp.mk2
-rw-r--r--mk/kernel-build.mk16
-rw-r--r--mk/kernel.mk9
-rw-r--r--mk/package.mk61
-rw-r--r--mk/pkg-bottom.mk2
-rw-r--r--mk/vars.mk23
7 files changed, 77 insertions, 49 deletions
diff --git a/mk/build.mk b/mk/build.mk
index d4cfab8c8..c3795b404 100644
--- a/mk/build.mk
+++ b/mk/build.mk
@@ -16,7 +16,9 @@ noconfig_targets:= menuconfig \
_mconfig \
tags
-MAKECLEAN_SYMBOLS= ADK_TARGET_LIB_UCLIBC ADK_TARGET_LIB_GLIBC ADK_SSP \
+MAKECLEAN_SYMBOLS= ADK_TARGET_LIB_UCLIBC \
+ ADK_TARGET_LIB_GLIBC \
+ ADK_TARGET_LIB_ECLIBC \
ADK_IPV6 ADK_CXX ADK_DEBUG
POSTCONFIG= -@\
if [ -f .config.old ];then \
@@ -66,8 +68,10 @@ endif
endif
package_index:
+ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
-cd ${PACKAGE_DIR} && \
${BASH} ${TOPDIR}/scripts/ipkg-make-index.sh . >Packages
+endif
$(DISTDIR):
mkdir -p $(DISTDIR)
@@ -120,6 +124,7 @@ switch:
root_clean:
@$(TRACE) root_clean
rm -rf $(TARGET_DIR)
+ mkdir -p $(TARGET_DIR)
# Do a per-package clean here, too. This way stale headers and
# libraries from cross_*/target/ get wiped away, which keeps
@@ -130,11 +135,11 @@ clean:
@$(TRACE) clean
$(MAKE) -C $(CONFIG) clean
for d in ${STAGING_PARENT_PFX}; do \
- echo "clean: entering $$d" ; \
+ #echo "clean: entering $$d" ; \
for f in $$(ls $$d/pkg/[a-z]* 2>/dev/null); do \
- echo "clean: cleaning for $$f" ; \
+ #echo "clean: cleaning for $$f" ; \
while read file ; do \
- rm $$d/target/$$file ; \
+ rm $$d/target/$$file 2>/dev/null; \
done < $$f ; \
rm $$f ; \
done \
diff --git a/mk/buildhlp.mk b/mk/buildhlp.mk
index afad521e2..684801617 100644
--- a/mk/buildhlp.mk
+++ b/mk/buildhlp.mk
@@ -88,7 +88,7 @@ endif
${BASH} ${TOPDIR}/scripts/update-patches); \
if [[ -n $$toedit && $$toedit != FAIL ]]; then \
echo -n 'edit patches: '; read i; \
- cd patches && $${VISUAL:-$${EDITOR:-/usr/bin/vi}} $$toedit; \
+ cd patches && $${VISUAL:-$${EDITOR:-vi}} $$toedit; \
fi; \
rm -rf ${WRKDIR}.orig; \
[[ $$toedit != FAIL ]]
diff --git a/mk/kernel-build.mk b/mk/kernel-build.mk
index b9b2d9b9b..b8dccfe84 100644
--- a/mk/kernel-build.mk
+++ b/mk/kernel-build.mk
@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
include $(TOPDIR)/mk/linux.mk
include ${TOPDIR}/mk/buildhlp.mk
-KERNEL_IDIR:=$(LINUX_BUILD_DIR)/kernel-ipkg
+KERNEL_PKGDIR:=$(LINUX_BUILD_DIR)/kernel-pkg
KERNEL_MAKE_OPTS:= -C "${LINUX_DIR}" V=1
ifneq ($(ADK_NATIVE),y)
@@ -41,23 +41,23 @@ $(LINUX_DIR)/vmlinux: $(LINUX_DIR)/.config
INSTALL_MOD_PATH=$(LINUX_BUILD_DIR)/modules \
modules_install $(MAKE_TRACE)
$(TRACE) target/$(DEVICE)-create-packages
- $(MAKE) $(KERNEL_IPKG) $(TARGETS)
+ $(MAKE) $(KERNEL_PKG) $(TARGETS)
touch -c $(LINUX_DIR)/vmlinux
-$(KERNEL_IPKG):
+$(KERNEL_PKG):
$(TRACE) target/$(DEVICE)-create-kernel-package
- rm -rf $(KERNEL_IDIR)
- @mkdir -p $(KERNEL_IDIR)/etc
- ${BASH} ${SCRIPT_DIR}/make-ipkg-dir.sh ${KERNEL_IDIR} \
+ rm -rf $(KERNEL_PKGDIR)
+ @mkdir -p $(KERNEL_PKGDIR)/etc
+ ${BASH} ${SCRIPT_DIR}/make-ipkg-dir.sh ${KERNEL_PKGDIR} \
../linux/kernel.control ${DEVICE}-${KERNEL_VERSION} ${CPU_ARCH}
- $(IPKG_BUILD) $(KERNEL_IDIR) $(PACKAGE_DIR) $(MAKE_TRACE)
+ $(PKG_BUILD) $(KERNEL_PKGDIR) $(PACKAGE_DIR) $(MAKE_TRACE)
prepare:
compile: $(LINUX_DIR)/vmlinux
install: compile
ifneq ($(strip $(INSTALL_TARGETS)),)
$(TRACE) target/${DEVICE}-modules-install
- $(IPKG) install $(INSTALL_TARGETS) $(MAKE_TRACE)
+ $(PKG_INSTALL) $(INSTALL_TARGETS) $(MAKE_TRACE)
endif
clean:
diff --git a/mk/kernel.mk b/mk/kernel.mk
index f5b85832e..365cc12e6 100644
--- a/mk/kernel.mk
+++ b/mk/kernel.mk
@@ -9,8 +9,8 @@ KMOD_BUILD_DIR := $(LINUX_BUILD_DIR)/linux-modules
MODULES_DIR := $(LINUX_BUILD_DIR)/modules/$(MODULES_SUBDIR)
TARGET_MODULES_DIR := $(LINUX_TARGET_DIR)/$(MODULES_SUBDIR)
-KERNEL_IPKG:=$(PACKAGE_DIR)/kernel_$(DEVICE)-$(KERNEL_VERSION)_$(CPU_ARCH).ipk
-INSTALL_TARGETS:= $(KERNEL_IPKG)
+KERNEL_PKG:=$(PACKAGE_DIR)/kernel_$(DEVICE)-$(KERNEL_VERSION)_$(CPU_ARCH).$(PKG_SUFFIX)
+INSTALL_TARGETS:= $(KERNEL_PKG)
NOINSTALL_TARGETS:=
TARGETS:=
@@ -32,7 +32,7 @@ define KMOD_template
IDEPENDK_$(1):=kernel ($(DEVICE)-$(KERNEL_VERSION)) $(foreach pkg,$(5),", $(pkg)")
-PKG_$(1) := $(PACKAGE_DIR)/kmod-$(2)_$(DEVICE)-$(KERNEL_VERSION)-$(KERNEL_RELEASE)_$(CPU_ARCH).ipk
+PKG_$(1) := $(PACKAGE_DIR)/kmod-$(2)_$(DEVICE)-$(KERNEL_VERSION)-$(KERNEL_RELEASE)_$(CPU_ARCH).$(PKG_SUFFIX)
I_$(1) := $(KMOD_BUILD_DIR)/ipkg/$(2)
ifeq ($$(ADK_KPACKAGE_KMOD_$(1)),m)
@@ -45,6 +45,7 @@ endif
$$(PKG_$(1)):
rm -rf $$(I_$(1))
+ @mkdir -p $$(I_$(1))
echo "Package: kmod-$(2)" > $(LINUX_BUILD_DIR)/kmod-control/kmod-$(2).control
echo "Priority: optional" >> $(LINUX_BUILD_DIR)/kmod-control/kmod-$(2).control
echo "Section: sys" >> $(LINUX_BUILD_DIR)/kmod-control/kmod-$(2).control
@@ -69,7 +70,7 @@ ifneq ($(4),)
chmod 0755 $$(I_$(1))/CONTROL/postinst
endif
endif
- $(IPKG_BUILD) $$(I_$(1)) $(PACKAGE_DIR) $(MAKE_TRACE)
+ $(PKG_BUILD) $$(I_$(1)) $(PACKAGE_DIR) $(MAKE_TRACE)
endef
include $(BUILD_DIR)/.kernelconfig
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
diff --git a/mk/pkg-bottom.mk b/mk/pkg-bottom.mk
index 64baf190c..fba5ee1a2 100644
--- a/mk/pkg-bottom.mk
+++ b/mk/pkg-bottom.mk
@@ -120,7 +120,9 @@ endif
[[ -e $$a ]] || continue; \
$(SED) "s,^prefix=.*,prefix=${STAGING_DIR}/usr," $$a; \
done
+ifeq (,$(filter libonly,${PKG_OPTS}))
@env ${MAKE_ENV} ${MAKE} post-install $(MAKE_TRACE)
+endif
ifeq (,$(filter noremove,${PKG_OPTS}))
@if test -s '${STAGING_PARENT}/pkg/${PKG_NAME}'; then \
cd '${STAGING_DIR}'; \
diff --git a/mk/vars.mk b/mk/vars.mk
index 63130507f..45975779f 100644
--- a/mk/vars.mk
+++ b/mk/vars.mk
@@ -69,17 +69,24 @@ HOST_CONFIGURE_OPTS= CC_FOR_BUILD='${HOSTCC}' \
CPPFLAGS_FOR_BUILD='${HOSTCPPFLAGS}' \
LDFLAGS_FOR_BUILD='${HOSTLDFLAGS}'
-# invoke ipkg-build with some default options
-IPKG_BUILD:= PATH='${TARGET_PATH}' ${BASH} \
- ${TOPDIR}/scripts/ipkg-build -c -o 0 -g 0
-# where to build (and put) .ipk packages
-IPKG_TARGET_DIR:= $(PACKAGE_DIR)
-IPKG:= IPKG_TMP=$(BUILD_DIR)/tmp \
+PKG_SUFFIX:= $(strip $(subst ",, $(ADK_PACKAGE_SUFFIX)))
+
+ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
+PKG_BUILD:= ${BASH} ${SCRIPT_DIR}/ipkg-build -c -o 0 -g 0
+
+PKG_INSTALL:= IPKG_TMP=$(BUILD_DIR)/tmp \
IPKG_INSTROOT=$(TARGET_DIR) \
IPKG_CONF_DIR=$(STAGING_DIR)/etc \
IPKG_OFFLINE_ROOT=$(TARGET_DIR) \
- ${BASH} ${SCRIPT_DIR}/ipkg -force-defaults -force-depends
-IPKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/ipkg
+ ${BASH} ${SCRIPT_DIR}/ipkg \
+ -force-defaults -force-depends install
+PKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/ipkg
+else
+PKG_BUILD:= ${BASH} ${SCRIPT_DIR}/tarpkg build
+PKG_INSTALL:= INSTROOT=$(TARGET_DIR) \
+ ${BASH} ${SCRIPT_DIR}/tarpkg install
+PKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/pkg
+endif
ifeq ($(ADK_NATIVE),y)
RSTRIP:= prefix=' ' ${BASH} ${SCRIPT_DIR}/rstrip.sh