Hi List,
How you already know, I use OpenWRT as building environment for my daily
activities.
Usually I work on a single package for a lot of days and I need to create
quickly a bootable build.
My wish is to have a shortcut that avoid all time-consuming targets into the
makefiles in order to produce my build for the rapid tests.
My typical day:
cd build_dir/my_arch/my_package
vi file1
vi file2
vi file3
...
cd ../../..
make V=99
cp bin/image.img /tftpboot
I would like to have a mechanism (using a global variable, ie QUICK=1) in
order to avoid all compilation targets and just entrusting the
my_package-{compile,install} to the developer.
My hypothetical future day:
cd build_dir/my_arch/my_package
vi file1
vi file2
vi file3
...
cd ../../..
make package/my_package-compile
make package/my_package-install
make V=99 QUICK=1 # fast!
cp bin/image.img /tftpboot
The idea is that when you develop on just a package, the others are unmodified
and all build/install activities can be safety skipped. QUICK=1 should just
enable the final filesystem image generation.
At this time I spend ~10min for each build... and this is not good. I'm
working on a patch for reduce the time, but I don't perfectly know the
complete targets dependencies and the actual patch version gain just 2
minutes.
Suggestion are welcome and I'm interested to have your opinions.
Best regards,
luigi
--
Luigi 'Comio' Mantellini
R&D - Software
Industrie Dial Face S.p.A.
Via Canzo, 4
20068 Peschiera Borromeo (MI), Italy
Tel.: +39 02 5167 2813
Fax: +39 02 5167 2459
Email: [email protected]
diff --git a/include/image.mk b/include/image.mk
index e70143d..eaacd3b 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -136,11 +136,15 @@ define BuildImage
download:
prepare:
ifneq ($(IB),1)
+ifeq ($(QUICK),)
compile: compile-targets FORCE
$(call Build/Compile)
else
compile:
endif
+else
+ compile:
+endif
ifneq ($(IB),1)
install: compile install-targets FORCE
diff --git a/include/kernel-build.mk b/include/kernel-build.mk
index 4774a69..ead797e 100644
--- a/include/kernel-build.mk
+++ b/include/kernel-build.mk
@@ -26,9 +26,11 @@ define Kernel/Configure
$(call Kernel/Configure/Default)
endef
+ifeq ($(QUICK),)
define Kernel/CompileModules
$(call Kernel/CompileModules/Default)
endef
+endif
define Kernel/CompileImage
$(call Kernel/CompileImage/Default)
@@ -54,19 +56,34 @@ define BuildKernel
$(if $(QUILT),$(Build/Quilt))
$(if $(LINUX_SITE),$(call Download,kernel))
+ifeq ($(QUICK),)
$(STAMP_PREPARED): $(DL_DIR)/$(LINUX_SOURCE)
-rm -rf $(KERNEL_BUILD_DIR)
-mkdir -p $(KERNEL_BUILD_DIR)
$(Kernel/Prepare)
touch $$@
+else
+ $(STAMP_PREPARED): $(DL_DIR)/$(LINUX_SOURCE)
+ touch $$@
+endif
+ifeq ($(QUICK),)
$(STAMP_CONFIGURED): $(STAMP_PREPARED) $(LINUX_CONFIG) $(GENERIC_LINUX_CONFIG) $(TOPDIR)/.config
$(Kernel/Configure)
touch $$@
+else
+ $(STAMP_CONFIGURED): $(STAMP_PREPARED) $(LINUX_CONFIG) $(GENERIC_LINUX_CONFIG) $(TOPDIR)/.config
+ touch $$@
+endif
+ifeq ($(QUICK),)
$(LINUX_DIR)/.modules: $(STAMP_CONFIGURED) $(LINUX_DIR)/.config FORCE
$(Kernel/CompileModules)
touch $$@
+else
+ $(LINUX_DIR)/.modules: $(STAMP_CONFIGURED) $(LINUX_DIR)/.config FORCE
+ touch $$@
+endif
$(LINUX_DIR)/.image: $(STAMP_CONFIGURED) FORCE
$(Kernel/CompileImage)
diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk
index 8d2ff83..f9359ea 100644
--- a/include/package-ipkg.mk
+++ b/include/package-ipkg.mk
@@ -82,7 +82,7 @@ ifeq ($(DUMP),)
$($(1)_COMMANDS) \
)
- $$(IPKG_$(1)): $(STAGING_DIR)/etc/ipkg.conf $(PKG_BUILD_DIR)/.built $$(IDIR_$(1))/CONTROL/control
+ $$(IPKG_$(1)): $(STAGING_DIR)/etc/ipkg.conf $(PKG_BUILD_DIR)/.built $(if $(QUICK),,$$(IDIR_$(1))/CONTROL/control)
$(call Package/$(1)/install,$$(IDIR_$(1)))
mkdir -p $(PACKAGE_DIR)
-find $$(IDIR_$(1)) -name 'CVS' -o -name '.svn' -o -name '.#*' | $(XARGS) rm -rf
diff --git a/include/package.mk b/include/package.mk
index dd81767..237e1ba 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -102,6 +102,7 @@ define Build/DefaultTargets
$(call Build/Autoclean)
$(STAMP_PREPARED) : export PATH=$$(TARGET_PATH_PKG)
+ifeq ($(QUICK),)
$(STAMP_PREPARED):
$(if $(wildcard $(STAMP_KEEP)),
echo Preserve $(PKG_NAME) sources...
@@ -113,15 +114,25 @@ define Build/DefaultTargets
$(foreach hook,$(Hooks/Prepare/Post),$(call $(hook))$(sep))
)
touch $$@
+else
+ $(STAMP_PREPARED):
+ touch $$@
+endif
$(call Build/Exports,$(STAMP_CONFIGURED))
+ifeq ($(QUICK),)
$(STAMP_CONFIGURED): $(STAMP_PREPARED)
$(foreach hook,$(Hooks/Configure/Pre),$(call $(hook))$(sep))
$(Build/Configure)
$(foreach hook,$(Hooks/Configure/Post),$(call $(hook))$(sep))
touch $$@
+else
+ $(STAMP_CONFIGURED): $(STAMP_PREPARED)
+ touch $$@
+endif
$(call Build/Exports,$(STAMP_BUILT))
+ifeq ($(QUICK),)
$(STAMP_BUILT): $(STAMP_CONFIGURED)
$(foreach hook,$(Hooks/Compile/Pre),$(call $(hook))$(sep))
$(Build/Compile)
@@ -129,8 +140,15 @@ define Build/DefaultTargets
$(Build/Install)
$(foreach hook,$(Hooks/Install/Post),$(call $(hook))$(sep))
touch $$@
+else
+ $(STAMP_BUILT): $(STAMP_CONFIGURED)
+ $(Build/Install)
+ $(foreach hook,$(Hooks/Install/Post),$(call $(hook))$(sep))
+ touch $$@
+endif
$(STAMP_INSTALLED) : export PATH=$$(TARGET_PATH_PKG)
+ifeq ($(QUICK),)
$(STAMP_INSTALLED): $(STAMP_BUILT)
$(SUBMAKE) -j1 clean-staging
rm -rf $(TMP_DIR)/stage-$(PKG_NAME)
@@ -148,6 +166,10 @@ define Build/DefaultTargets
fi
rm -rf $(TMP_DIR)/stage-$(PKG_NAME)
touch $$@
+else
+ $(STAMP_INSTALLED): $(STAMP_BUILT)
+ touch $$@
+endif
ifdef Build/InstallDev
compile: $(STAMP_INSTALLED)
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel