summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
Diffstat (limited to 'mk')
-rw-r--r--mk/build.mk18
-rw-r--r--mk/image.mk4
-rw-r--r--mk/kernel-build.mk11
-rw-r--r--mk/kernel.mk6
-rw-r--r--mk/modules.mk6
-rw-r--r--mk/package.mk5
6 files changed, 38 insertions, 12 deletions
diff --git a/mk/build.mk b/mk/build.mk
index f71808b3f..a7a464394 100644
--- a/mk/build.mk
+++ b/mk/build.mk
@@ -164,9 +164,15 @@ switch:
else echo "No old target config found";mv .config .config.bak; make TARGET=${TARGET};fi
kernelconfig:
+ifeq ($(ADKtype),)
cp $(TOPDIR)/target/$(ADK_TARGET)/kernel.config $(BUILD_DIR)/linux/.config
$(MAKE) -C $(BUILD_DIR)/linux/ ARCH=$(ARCH) menuconfig
cp $(BUILD_DIR)/linux/.config $(TOPDIR)/target/$(ADK_TARGET)/kernel.config
+else
+ cp $(TOPDIR)/target/$(ADKtype)/kernel.config $(BUILD_DIR)/linux/.config
+ $(MAKE) -C $(BUILD_DIR)/linux/ ARCH=$(ARCH) menuconfig
+ cp $(BUILD_DIR)/linux/.config $(TOPDIR)/target/$(ADKtype)/kernel.config
+endif
# create a new package from package/.template
newpackage:
@@ -294,6 +300,12 @@ endif
ifneq (,$(filter CYGWIN%,${OStype}))
@echo ADK_HOST_CYGWIN=y > $(TOPDIR)/.defconfig
endif
+ifeq ($(ADKtype),ibmx40)
+ @echo ADK_HARDWARE_IBMX40=y >> $(TOPDIR)/.defconfig
+endif
+ifeq ($(ADKtype),lemote)
+ @echo ADK_HARDWARE_YEELONG=y >> $(TOPDIR)/.defconfig
+endif
@if [ ! -z "$(TARGET)" ];then \
grep "^config" target/Config.in \
|grep -i "$(TARGET)"\$$ \
@@ -365,6 +377,12 @@ endif
ifneq (,$(filter CYGWIN%,${OStype}))
@echo ADK_HOST_CYGWIN=y > $(TOPDIR)/all.config
endif
+ifeq ($(ADKtype),ibmx40)
+ @echo ADK_HARDWARE_IBMX40=y >> $(TOPDIR)/all.config
+endif
+ifeq ($(ADKtype),lemote)
+ @echo ADK_HARDWARE_YEELONG=y >> $(TOPDIR)/all.config
+endif
@if [ ! -z "$(TARGET)" ];then \
grep "^config" target/Config.in \
|grep -i "$(TARGET)"\$$ \
diff --git a/mk/image.mk b/mk/image.mk
index 6c3b1e5f9..1ca9ac29b 100644
--- a/mk/image.mk
+++ b/mk/image.mk
@@ -22,7 +22,7 @@ image-prepare-post:
fi
KERNEL_PKGDIR:=$(LINUX_BUILD_DIR)/kernel-pkg
-KERNEL_PKG:=$(PACKAGE_DIR)/kernel_$(ADK_TARGET)-$(KERNEL_VERSION)_$(CPU_ARCH).$(PKG_SUFFIX)
+KERNEL_PKG:=$(PACKAGE_DIR)/kernel_$(KERNEL_VERSION)_$(CPU_ARCH).$(PKG_SUFFIX)
kernel-package: $(LINUX_DIR)/vmlinux
$(TRACE) target/$(ADK_TARGET)-create-kernel-package
@@ -30,7 +30,7 @@ kernel-package: $(LINUX_DIR)/vmlinux
@mkdir -p $(KERNEL_PKGDIR)/boot
cp $(KERNEL) $(KERNEL_PKGDIR)/boot/vmlinuz-adk
@${BASH} ${SCRIPT_DIR}/make-ipkg-dir.sh ${KERNEL_PKGDIR} \
- ../linux/kernel.control ${ADK_TARGET}-${KERNEL_VERSION} ${CPU_ARCH}
+ ../linux/kernel.control ${KERNEL_VERSION} ${CPU_ARCH}
$(PKG_BUILD) $(KERNEL_PKGDIR) $(PACKAGE_DIR) $(MAKE_TRACE)
$(TRACE) target/$(ADK_TARGET)-install-kernel-package
$(PKG_INSTALL) $(KERNEL_PKG) $(MAKE_TRACE)
diff --git a/mk/kernel-build.mk b/mk/kernel-build.mk
index 8ee6d1ac3..68fe897a3 100644
--- a/mk/kernel-build.mk
+++ b/mk/kernel-build.mk
@@ -9,6 +9,12 @@ $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNE
$(TRACE) target/$(ADK_TARGET)-kernel-patch
$(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) ../linux/patches/$(KERNEL_VERSION) *.patch $(MAKE_TRACE)
$(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) ../$(ADK_TARGET)/patches *.patch $(MAKE_TRACE)
+ifeq ($(ADK_NATIVE),y)
+ if [ -f /etc/adktarget ];then \
+ target=$$(cat /etc/adktarget); \
+ $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) ../$$target/patches *.patch $(MAKE_TRACE); \
+ fi
+endif
touch $@
$(LINUX_DIR)/.prepared: $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION)/.patched
@@ -17,7 +23,7 @@ $(LINUX_DIR)/.prepared: $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PK
mkdir -p $(LINUX_BUILD_DIR)/kmod-control
touch $@
-$(LINUX_DIR)/.config: $(LINUX_DIR)/.prepared $(BUILD_DIR)/.kernelconfig
+$(LINUX_DIR)/.config: $(LINUX_DIR)/.prepared $(BUILD_DIR)/.kernelconfig $(TOPDIR)/mk/modules.mk
$(TRACE) target/$(ADK_TARGET)-kernel-configure
for f in $(TARGETS);do if [ -f $$f ];then rm $$f;fi;done $(MAKE_TRACE)
$(CP) $(BUILD_DIR)/.kernelconfig $(LINUX_DIR)/.config
@@ -27,11 +33,12 @@ $(LINUX_DIR)/.config: $(LINUX_DIR)/.prepared $(BUILD_DIR)/.kernelconfig
$(LINUX_DIR)/vmlinux: $(LINUX_DIR)/.config
$(TRACE) target/$(ADK_TARGET)-kernel-compile
- $(MAKE) ${KERNEL_MAKE_OPTS} -j${ADK_MAKE_JOBS} $(MAKE_TRACE)
+ $(MAKE) LOCALVERSION="" ${KERNEL_MAKE_OPTS} -j${ADK_MAKE_JOBS} $(MAKE_TRACE)
$(TRACE) target/$(ADK_TARGET)-kernel-modules-install
rm -rf $(LINUX_BUILD_DIR)/modules
$(MAKE) ${KERNEL_MAKE_OPTS} DEPMOD=true \
INSTALL_MOD_PATH=$(LINUX_BUILD_DIR)/modules \
+ LOCALVERSION="" \
modules_install $(MAKE_TRACE)
$(TRACE) target/$(ADK_TARGET)-create-packages
ifneq ($(strip $(TARGETS)),)
diff --git a/mk/kernel.mk b/mk/kernel.mk
index a8b3884da..eb4e52a33 100644
--- a/mk/kernel.mk
+++ b/mk/kernel.mk
@@ -28,9 +28,9 @@ TARGETS:=
#
define KMOD_template
-IDEPENDK_$(1):=kernel ($(ADK_TARGET)-$(KERNEL_VERSION)) $(foreach pkg,$(5),", $(pkg)")
+IDEPENDK_$(1):=kernel ($(KERNEL_VERSION)) $(foreach pkg,$(5),", $(pkg)")
-PKG_$(1) := $(PACKAGE_DIR)/kmod-$(2)_$(ADK_TARGET)-$(KERNEL_VERSION)-$(KERNEL_RELEASE)_$(CPU_ARCH).$(PKG_SUFFIX)
+PKG_$(1) := $(PACKAGE_DIR)/kmod-$(2)_$(KERNEL_VERSION)-$(KERNEL_RELEASE)_$(CPU_ARCH).$(PKG_SUFFIX)
I_$(1) := $(KMOD_BUILD_DIR)/ipkg/$(2)
ifeq ($$(ADK_KPACKAGE_KMOD_$(1)),m)
@@ -50,7 +50,7 @@ $$(PKG_$(1)):
echo "Description: kernel module $(2)" >> $(LINUX_BUILD_DIR)/kmod-control/kmod-$(2).control
${BASH} ${SCRIPT_DIR}/make-ipkg-dir.sh $$(I_$(1)) \
$(LINUX_BUILD_DIR)/kmod-control/kmod-$(2).control \
- $(ADK_TARGET)-$(KERNEL_VERSION)-$(KERNEL_RELEASE) $(CPU_ARCH)
+ $(KERNEL_VERSION)-$(KERNEL_RELEASE) $(CPU_ARCH)
echo "Depends: $$(IDEPENDK_$(1))" >> $$(I_$(1))/CONTROL/control
ifneq ($(strip $(3)),)
mkdir -p $$(I_$(1))/lib/modules/$(KERNEL_VERSION)
diff --git a/mk/modules.mk b/mk/modules.mk
index 10f9a6266..aac667376 100644
--- a/mk/modules.mk
+++ b/mk/modules.mk
@@ -61,7 +61,7 @@ $(eval $(call KMOD_template,SKY2,sky2,\
$(eval $(call KMOD_template,MAC80211,mac80211,\
$(MODULES_DIR)/kernel/net/wireless/cfg80211 \
$(MODULES_DIR)/kernel/net/mac80211/mac80211 \
-,15, kmod-crypto-aes kmod-crypto-arc4 kmod-crypto-ecb kmod-crc32))
+,15, kmod-crypto-aes kmod-crypto-arc4 kmod-crypto-ecb))
$(eval $(call KMOD_template,ATH5K,ath5k,\
$(MODULES_DIR)/kernel/drivers/net/wireless/ath/ath \
@@ -72,8 +72,8 @@ $(eval $(call KMOD_template,P54_COMMON,p54-common,\
$(MODULES_DIR)/kernel/drivers/net/wireless/p54/p54common \
,68))
-$(eval $(call KMOD_template,RTL8187B,rtl8187b,\
- $(MODULES_DIR)/kernel/drivers/net/wireless/rtl8187b/rtl8187b \
+$(eval $(call KMOD_template,RTL8187,rtl8187,\
+ $(MODULES_DIR)/kernel/drivers/net/wireless/rtl818x/rtl8187 \
,70))
$(eval $(call KMOD_template,B43,b43,\
diff --git a/mk/package.mk b/mk/package.mk
index 30965e17b..0fa82fbba 100644
--- a/mk/package.mk
+++ b/mk/package.mk
@@ -77,10 +77,11 @@ MAKE_ENV+= WRKDIR='${WRKDIR}' WRKDIST='${WRKDIST}' \
CXXFLAGS='$(strip ${TCXXFLAGS})' \
CPPFLAGS='$(strip ${TCPPFLAGS})' \
LDFLAGS='$(strip ${TLDFLAGS})'
+MAKE_ENV+= PATH='${TARGET_PATH}'
ifeq ($(ADK_NATIVE),)
MAKE_ENV+= PATH='${TARGET_PATH}' \
- ${HOST_CONFIGURE_OPTS} \
PKG_CONFIG_LIBDIR='${STAGING_DIR}/usr/lib/pkgconfig' \
+ ${HOST_CONFIGURE_OPTS} \
CC='${TARGET_CC}' \
CXX='${TARGET_CXX}' \
AR='${TARGET_CROSS}ar' \
@@ -208,7 +209,7 @@ ifeq (,$(filter noremove,$(7)))
fi
endif
@rm -f '$${STAGING_PARENT}/pkg/$(1)'
- @-cd $${IDIR_$(1)}; \
+ -cd $${IDIR_$(1)}; \
x=$$$$(find tmp var -mindepth 1 2>/dev/null); if [[ -n $$$$x ]]; then \
echo 'WARNING: $${IPKG_$(1)} installs files into a' \
'ramdisk location:' >&2; \