summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/Makefile12
-rw-r--r--apps/builtin/Makefile24
2 files changed, 24 insertions, 12 deletions
diff --git a/apps/Makefile b/apps/Makefile
index fc04a8878..d580d2f10 100644
--- a/apps/Makefile
+++ b/apps/Makefile
@@ -45,7 +45,7 @@ TOPDIR ?= $(APPDIR)/import
# CONFIGURED_APPS is the list of all configured built-in directories/built
# action.
# SUBDIRS is the list of all directories containing Makefiles. It is used
-# only for cleaning. builtin must always be the first in the list.
+# only for cleaning.
CONFIGURED_APPS =
SUBDIRS = examples graphics interpreters modbus builtin import nshlib
@@ -114,7 +114,7 @@ BIN = libapps$(LIBEXT)
# Build targets
all: $(BIN)
-.PHONY: import install context .depdirs depend clean distclean
+.PHONY: import install context context_serialize context_rest .depdirs depend clean distclean
define SDIR_template
$(1)_$(2):
@@ -142,7 +142,13 @@ install: $(BIN_DIR) .install
import:
$(Q) $(MAKE) .import TOPDIR="$(APPDIR)$(DELIM)import"
-context: $(foreach SDIR, $(INSTALLED_APPS), $(SDIR)_context)
+context_rest: $(foreach SDIR, $(INSTALLED_APPS), $(SDIR)_context)
+
+context_serialize:
+ $(Q) $(MAKE) -C builtin context TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
+ $(Q) $(MAKE) context_rest
+
+context: context_serialize
.depdirs: $(foreach SDIR, $(INSTALLED_APPS), $(SDIR)_depend)
diff --git a/apps/builtin/Makefile b/apps/builtin/Makefile
index 57d7a432b..9fd170be5 100644
--- a/apps/builtin/Makefile
+++ b/apps/builtin/Makefile
@@ -74,35 +74,39 @@ $(COBJS): %$(OBJEXT): %.c
registry$(DELIM).updated:
$(Q) $(MAKE) -C registry .updated TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
+builtin_list$(OBJEXT): builtin_list.h builtin_proto.h
+
builtin_list.h: registry$(DELIM).updated
- $(call DELFILE, builtin_list.h)
- $(Q) touch builtin_list.h
+ $(call DELFILE, .xx_builtin_list.h)
+ $(Q) touch .xx_builtin_list.h
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
- $(Q) (for /f %%G in ('dir /b registry\*.bdat') do ( type registry\%%G >> builtin_list.h )) || echo ""
+ $(Q) (for /f %%G in ('dir /b registry\*.bdat') do ( type registry\%%G >> .xx_builtin_list.h )) || echo ""
else
$(Q) ( \
filelist=`ls registry/*.bdat 2>/dev/null || echo ""`; \
for file in $$filelist; \
- do cat $$file >> builtin_list.h; \
+ do cat $$file >> .xx_builtin_list.h; \
done; \
)
endif
+ $(Q) mv .xx_builtin_list.h builtin_list.h
builtin_proto.h: registry$(DELIM).updated
- $(call DELFILE, builtin_proto.h)
- $(Q) touch builtin_proto.h
+ $(call DELFILE, .xx_builtin_proto.h)
+ $(Q) touch .xx_builtin_proto.h
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
- $(Q) (for /f %%G in ('dir /b registry\*.pdat') do ( type registry\%%G >> builtin_proto.h )) || echo ""
+ $(Q) (for /f %%G in ('dir /b registry\*.pdat') do ( type registry\%%G >> .xx_builtin_proto.h )) || echo ""
else
$(Q) ( \
filelist=`ls registry/*.pdat 2>/dev/null || echo ""`; \
for file in $$filelist; \
- do cat $$file >> builtin_proto.h; \
+ do cat $$file >> .xx_builtin_proto.h; \
done; \
)
endif
+ $(Q) mv .xx_builtin_proto.h builtin_proto.h
-.built: builtin_list.h builtin_proto.h $(OBJS)
+.built: $(OBJS)
$(call ARCHIVE, $(BIN), $(OBJS))
$(Q) touch .built
@@ -120,6 +124,8 @@ depend: .depend
clean:
$(Q) $(MAKE) -C registry clean TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
$(call DELFILE, .built)
+ $(call DELFILE, .xx_builtin_list.h)
+ $(call DELFILE, .xx_builtin_proto.h)
$(call CLEAN)
distclean: clean