nuttx-apps/Directory.mk

64 lines
2.1 KiB
Makefile
Raw Normal View History

2015-09-23 17:09:29 +02:00
############################################################################
# apps/Directory.mk
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
2015-09-23 17:09:29 +02:00
#
# http:#www.apache.org/licenses/LICENSE-2.0
2015-09-23 17:09:29 +02:00
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
2015-09-23 17:09:29 +02:00
#
############################################################################
2016-06-02 16:34:00 +02:00
include $(APPDIR)/Make.defs
2015-09-23 17:09:29 +02:00
# Sub-directories that have been built or configured.
2015-09-23 17:09:29 +02:00
SUBDIRS := $(dir $(wildcard */Makefile))
CONFIGSUBDIRS := $(filter-out $(dir $(wildcard */Kconfig)),$(SUBDIRS))
apps/build: Restore ARLOCK to improve compile speed in incremental case To solve the issue of carrying object files from previous builds, Matias changed the archiving process to re-archive libapps.a on every compilation, if libapps.a carries more object files, incremental compilation will waste too many time in re-archiving, compared with the previous implement, this is a degradation of the build system. Referring to mature engineering projects such as cmake, if there is configuration or source file changed, the best solution should be to reconfigure the environment. Revert this PR to ensure the compilation speed during incremental compilation. | commit 18137c0fec3cea30871f29238e11ea0f4e8523da | Author: Matias N <matias@protobits.dev> | Date: Sat Sep 12 00:36:23 2020 -0300 | | Fix: ensure archive files do not carry object files from prior builds | | This is the corresponding change to the one on main NuttX repo. In this | case this involves splitting the build of libapps.a into: a) building | all applications (which is safely parallelizable), b) adding each | application's object files to the archive in turns (serial by nature). | | This removes the need for the flock used to protect the parallel build. Testing: sim:nsh ------------------------------- | Patched | Current ------------------------------- |$ time make | $ time make |real 0m1.270s | real 0m1.728s |user 0m0.971s | user 0m1.276s |sys 0m0.363s | sys 0m0.530s ------------------------------- Private project (20+ 3rd library needs archive to libapps.a) ------------------------------- | Patched | Current ------------------------------- |$ time make | $ time make |real 0m21.181s | real 0m39.721s |user 0m14.638s | user 0m24.837s |sys 0m6.919s | sys 0m14.394s ------------------------------- Signed-off-by: chao an <anchao@xiaomi.com>
2023-09-11 05:54:19 +02:00
CLEANSUBDIRS := $(dir $(wildcard *$(DELIM).built))
CLEANSUBDIRS += $(dir $(wildcard */.depend))
CLEANSUBDIRS += $(dir $(wildcard */.kconfig))
CLEANSUBDIRS := $(sort $(CLEANSUBDIRS))
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
CONFIGSUBDIRS := $(subst /,\,$(CONFIGSUBDIRS))
CLEANSUBDIRS := $(subst /,\,$(CLEANSUBDIRS))
endif
2015-09-23 17:09:29 +02:00
all: nothing
.PHONY: nothing clean distclean
2015-09-23 17:09:29 +02:00
$(foreach SDIR, $(CONFIGSUBDIRS), $(eval $(call SDIR_template,$(SDIR),preconfig)))
$(foreach SDIR, $(CLEANSUBDIRS), $(eval $(call SDIR_template,$(SDIR),clean)))
$(foreach SDIR, $(CLEANSUBDIRS), $(eval $(call SDIR_template,$(SDIR),distclean)))
2015-09-23 17:09:29 +02:00
nothing:
install:
preconfig: $(foreach SDIR, $(CONFIGSUBDIRS), $(SDIR)_preconfig)
ifneq ($(MENUDESC),)
2016-06-09 16:59:16 +02:00
$(Q) $(MKKCONFIG) -m $(MENUDESC)
endif
$(Q) touch .kconfig
2016-06-02 16:34:00 +02:00
clean: $(foreach SDIR, $(CLEANSUBDIRS), $(SDIR)_clean)
@:
2015-09-23 17:09:29 +02:00
distclean: $(foreach SDIR, $(CLEANSUBDIRS), $(SDIR)_distclean)
ifneq ($(MENUDESC),)
$(call DELFILE, Kconfig)
endif
$(call DELFILE, .kconfig)
2015-09-23 17:09:29 +02:00
-include Make.dep