2015-08-29 02:23:30 +08:00
|
|
|
# vim: filetype=make
|
|
|
|
|
|
|
|
ifneq ("$(wildcard $(MDEF_FILE))","")
|
2016-01-06 05:28:58 +08:00
|
|
|
MDEF_FILE_PATH=$(strip $(MDEF_FILE))
|
2015-08-29 02:23:30 +08:00
|
|
|
else
|
2015-10-06 21:05:51 +08:00
|
|
|
ifneq ($(MDEF_FILE),)
|
2016-01-06 05:28:58 +08:00
|
|
|
MDEF_FILE_PATH=$(strip $(PROJECT_BASE)/$(MDEF_FILE))
|
2015-08-29 02:23:30 +08:00
|
|
|
endif
|
2015-10-06 21:05:51 +08:00
|
|
|
endif
|
2015-08-29 02:23:30 +08:00
|
|
|
|
2016-09-03 04:04:29 +08:00
|
|
|
ifeq (${CONFIG_NUM_COMMAND_PACKETS},)
|
|
|
|
CONFIG_NUM_COMMAND_PACKETS=0
|
|
|
|
endif
|
|
|
|
ifeq (${CONFIG_NUM_TIMER_PACKETS},)
|
|
|
|
CONFIG_NUM_TIMER_PACKETS=0
|
|
|
|
endif
|
|
|
|
ifeq (${CONFIG_NUM_TASK_PRIORITIES},)
|
|
|
|
CONFIG_NUM_TASK_PRIORITIES=$(CONFIG_NUM_PREEMPT_PRIORITIES)
|
|
|
|
endif
|
|
|
|
|
2016-06-10 06:27:12 +08:00
|
|
|
ifeq ($(ARCH),x86)
|
|
|
|
TASKGROUP_SSE=" TASKGROUP SSE"
|
|
|
|
endif
|
|
|
|
|
2015-08-29 02:23:30 +08:00
|
|
|
define filechk_prj.mdef
|
|
|
|
(echo "% WARNING. THIS FILE IS AUTO-GENERATED. DO NOT MODIFY!"; \
|
|
|
|
echo; \
|
|
|
|
echo "% CONFIG NUM_COMMAND_PACKETS NUM_TIMER_PACKETS NUM_TASK_PRIORITIES"; \
|
|
|
|
echo "% ============================================================="; \
|
|
|
|
echo " CONFIG ${CONFIG_NUM_COMMAND_PACKETS} ${CONFIG_NUM_TIMER_PACKETS} ${CONFIG_NUM_TASK_PRIORITIES}"; \
|
|
|
|
echo; \
|
|
|
|
echo "% TASKGROUP NAME";\
|
|
|
|
echo "% ==============";\
|
|
|
|
echo " TASKGROUP EXE";\
|
|
|
|
echo " TASKGROUP SYS";\
|
|
|
|
echo " TASKGROUP FPU";\
|
2016-06-10 06:27:12 +08:00
|
|
|
echo $(TASKGROUP_SSE);\
|
2015-08-29 02:23:30 +08:00
|
|
|
echo; \
|
2015-10-06 21:05:51 +08:00
|
|
|
if test -e "$(MDEF_FILE_PATH)"; then \
|
|
|
|
cat $(MDEF_FILE_PATH); \
|
|
|
|
fi;)
|
2015-08-29 02:23:30 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
misc/generated/sysgen/prj.mdef: $(MDEF_FILE_PATH) \
|
|
|
|
include/config/auto.conf FORCE
|
|
|
|
$(call filechk,prj.mdef)
|
|
|
|
|
2016-06-08 03:58:43 +08:00
|
|
|
sysgen_cmd=$(strip \
|
|
|
|
$(PYTHON) $(srctree)/scripts/sysgen \
|
|
|
|
-i $(CURDIR)/misc/generated/sysgen/prj.mdef \
|
|
|
|
-o $(CURDIR)/misc/generated/sysgen/ \
|
2016-09-03 04:04:29 +08:00
|
|
|
-k $(if $(CONFIG_KERNEL_V2),unified,micro) \
|
2016-06-08 03:58:43 +08:00
|
|
|
)
|
|
|
|
|
2016-07-09 22:30:52 +08:00
|
|
|
misc/generated/sysgen/kernel_main.c: misc/generated/sysgen/prj.mdef \
|
|
|
|
kernel/microkernel/include/micro_private_types.h \
|
|
|
|
kernel/microkernel/include/kernel_main.h
|
2016-06-08 03:58:43 +08:00
|
|
|
$(Q)$(sysgen_cmd)
|
2015-08-29 02:23:30 +08:00
|
|
|
|
|
|
|
define filechk_configs.c
|
|
|
|
(echo "/* file is auto-generated, do not modify ! */"; \
|
|
|
|
echo; \
|
|
|
|
echo "#include <toolchain.h>"; \
|
|
|
|
echo; \
|
|
|
|
echo "GEN_ABS_SYM_BEGIN (_ConfigAbsSyms)"; \
|
|
|
|
echo; \
|
|
|
|
cat $(CURDIR)/include/generated/autoconf.h | sed \
|
|
|
|
's/".*"/1/' | awk \
|
|
|
|
'/#define/{printf "GEN_ABSOLUTE_SYM(%s, %s);\n", $$2, $$3}'; \
|
|
|
|
echo; \
|
|
|
|
echo "GEN_ABS_SYM_END";)
|
|
|
|
endef
|
|
|
|
|
|
|
|
misc/generated/configs.c: include/config/auto.conf FORCE
|
|
|
|
$(call filechk,configs.c)
|
|
|
|
|
|
|
|
targets := misc/generated/configs.c
|
|
|
|
targets += include/generated/offsets.h
|
|
|
|
|
|
|
|
|
|
|
|
always := misc/generated/configs.c
|
|
|
|
always += include/generated/offsets.h
|
|
|
|
|
2016-09-03 04:04:29 +08:00
|
|
|
ifeq ($(CONFIG_MDEF),y)
|
2015-08-29 02:23:30 +08:00
|
|
|
targets += misc/generated/sysgen/kernel_main.c
|
|
|
|
always += misc/generated/sysgen/kernel_main.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
define rule_cc_o_c_1
|
|
|
|
$(call echo-cmd,cc_o_c_1) $(cmd_cc_o_c_1);
|
|
|
|
endef
|
|
|
|
|
2016-09-03 04:04:29 +08:00
|
|
|
ifeq ($(CONFIG_KERNEL_V2),y)
|
|
|
|
OFFSETS_INCLUDE_KERNEL_LOCATION=$(strip \
|
|
|
|
-I $(srctree)/kernel/unified/include \
|
|
|
|
)
|
|
|
|
else
|
|
|
|
OFFSETS_INCLUDE_KERNEL_LOCATION=$(strip \
|
|
|
|
-I $(srctree)/kernel/microkernel/include \
|
|
|
|
-I $(srctree)/kernel/nanokernel/include \
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2015-08-29 02:23:30 +08:00
|
|
|
OFFSETS_INCLUDE = $(strip \
|
2015-08-29 03:41:09 +08:00
|
|
|
-include $(CURDIR)/include/generated/autoconf.h \
|
2015-08-29 02:23:30 +08:00
|
|
|
-I $(srctree)/include \
|
|
|
|
-I $(CURDIR)/include/generated \
|
2016-09-03 04:04:29 +08:00
|
|
|
$(OFFSETS_INCLUDE_KERNEL_LOCATION) \
|
2015-08-29 02:23:30 +08:00
|
|
|
-I $(srctree)/lib/libc/minimal/include \
|
2015-11-03 09:42:35 +08:00
|
|
|
-I $(srctree)/arch/${ARCH}/include )
|
2015-08-29 02:23:30 +08:00
|
|
|
|
2015-08-29 03:41:09 +08:00
|
|
|
cmd_cc_o_c_1 = $(CC) $(KBUILD_CFLAGS) $(OFFSETS_INCLUDE) -c -o $@ $<
|
2015-08-29 02:23:30 +08:00
|
|
|
|
2016-05-17 08:06:42 +08:00
|
|
|
arch/$(ARCH)/core/offsets/offsets.o: arch/$(ARCH)/core/offsets/offsets.c $(KCONFIG_CONFIG)
|
2015-08-29 02:23:30 +08:00
|
|
|
$(Q)mkdir -p $(dir $@)
|
2015-08-29 03:04:39 +08:00
|
|
|
$(call if_changed,cc_o_c_1)
|
|
|
|
|
|
|
|
|
|
|
|
define offsetchk
|
|
|
|
$(Q)set -e; \
|
|
|
|
$(kecho) ' CHK $@'; \
|
|
|
|
mkdir -p $(dir $@); \
|
|
|
|
$(GENOFFSET_H) -i $(1) -o $@.tmp; \
|
|
|
|
if [ -r $@ ] && cmp -s $@ $@.tmp; then \
|
|
|
|
rm -f $@.tmp; \
|
|
|
|
else \
|
|
|
|
$(kecho) ' UPD $@'; \
|
|
|
|
mv -f $@.tmp $@; \
|
|
|
|
fi
|
|
|
|
endef
|
2015-08-29 02:23:30 +08:00
|
|
|
|
2015-12-16 06:34:41 +08:00
|
|
|
include/generated/offsets.h: arch/$(ARCH)/core/offsets/offsets.o \
|
2015-08-29 03:04:39 +08:00
|
|
|
include/config/auto.conf FORCE
|
2015-11-03 09:42:35 +08:00
|
|
|
$(call offsetchk,arch/$(ARCH)/core/offsets/offsets.o)
|
2015-08-23 02:40:43 +08:00
|
|
|
|