mars/kernel/Makefile

114 lines
3.1 KiB
Makefile
Raw Normal View History

2010-06-14 14:27:40 +00:00
#
# Makefile for MARS
#
ifneq ($(KBUILD_EXTMOD),)
CONFIG_MARS_BIGMODULE := m
endif
KBUILD_CFLAGS += -fdelete-null-pointer-checks
mars-objs := \
brick_say.o \
brick_mem.o \
brick.o \
mars_generic.o \
lib_log.o \
2012-02-11 19:08:41 +00:00
lib_rank.o \
2012-09-24 09:17:00 +00:00
lib_limiter.o \
2012-10-12 12:17:34 +00:00
lib_timing.o \
lib_mapfree.o \
mars_net.o \
mars_server.o \
mars_client.o \
mars_aio.o \
mars_sio.o \
mars_bio.o \
mars_if.o \
mars_copy.o \
mars_trans_logger.o \
sy_old/sy_generic.o \
sy_old/sy_net.o \
sy_old/mars_proc.o \
2011-08-25 10:16:32 +00:00
sy_old/mars_light.o
obj-$(CONFIG_MARS_BIGMODULE) += mars.o
#### alternatives when building small individual modules
2010-06-14 14:27:40 +00:00
obj-$(CONFIG_MARS_DUMMY) += mars_dummy.o
2010-11-26 13:45:10 +00:00
obj-$(CONFIG_MARS_CHECK) += mars_check.o
2011-03-07 10:27:38 +00:00
obj-$(CONFIG_MARS_IF) += mars_if.o
2011-03-18 13:15:40 +00:00
obj-$(CONFIG_MARS_BIO) += mars_bio.o
2011-03-07 10:27:38 +00:00
obj-$(CONFIG_MARS_AIO) += mars_aio.o
obj-$(CONFIG_MARS_SIO) += mars_sio.o
2010-11-26 13:45:10 +00:00
obj-$(CONFIG_MARS_BUF) += mars_buf.o
obj-$(CONFIG_MARS_USEBUF) += mars_usebuf.o
2011-07-22 10:43:40 +00:00
obj-$(CONFIG_MARS_TRANS_LOGGER) += mars_trans_logger.o lib_log.o
2011-02-23 20:48:06 +00:00
obj-$(CONFIG_MARS_SERVER) += mars_server.o
obj-$(CONFIG_MARS_CLIENT) += mars_client.o
obj-$(CONFIG_MARS_COPY) += mars_copy.o
2010-06-14 14:27:40 +00:00
2011-08-25 10:16:32 +00:00
obj-$(CONFIG_MARS_LIGHT) += sy_old/mars_light.o \
brick.o brick_mem.o brick_say.o \
2011-08-25 10:16:32 +00:00
mars_generic.o sy_old/sy_generic.o \
mars_net.o sy_old/sy_net.o \
sy_old/mars_proc.o
2011-03-22 14:36:26 +00:00
ifdef CONFIG_DEBUG_KERNEL
2011-03-22 14:36:26 +00:00
KBUILD_CFLAGS += -fno-inline-functions -fno-inline-small-functions -fno-inline-functions-called-once
# This is currently not really used.
# We urge people to maintain it by including it in debug versions
# (so the compiler may throw any complaints)
mars-objs += \
mars_dummy.o \
mars_check.o \
mars_buf.o \
mars_usebuf.o \
2011-03-22 14:36:26 +00:00
endif
2011-09-30 11:55:18 +00:00
#
# buildtag.h should be regenerated in every build. If a file
# 'DISTVERSION' exists (out-of-tree tarball), its content is
# used as the BUILDTAG. Otherwise, if git is available, the
# git HEAD revision is used instead.
#
extra-y += buildtag.h
$(obj)/buildtag.h: $(patsubst $(obj)/buildtag.h,,$(wildcard $(obj)/*.[ch])) $(obj)/*/*.[ch]
$(Q)$(kecho) "MARS: Generating $@"
$(Q)set -e; \
exec > $@;\
2011-10-17 15:01:15 +00:00
/bin/echo -e "/* Automatically generated -- DO NOT EDIT! */";\
cd $(src); \
if [ -e DISTVERSION ]; then \
BUILDTAG=$$(cat DISTVERSION); \
elif git rev-parse --git-dir >/dev/null 2>&1; then \
BUILDTAG="$$(git rev-parse HEAD)"; \
else \
BUILDTAG="no-buildtag-available"; \
fi; \
/bin/echo -e "#define BUILDTAG \"$$BUILDTAG\"";\
2011-10-17 15:01:15 +00:00
/bin/echo -e "#define BUILDHOST \"$$USER@$$HOSTNAME\"";\
/bin/echo -e "#define BUILDDATE \"$$(date '+%F %T')\""
#
# mars_config.h is generated by a simple Kconfig parser (gen_config.pl)
# at build time.
# It is used for out-of-tree builds.
# In-tree builds should not be disturbed due to #ifndef safeguarding.
#
extra-y += mars_config.h
GEN_CONFIG_SCRIPT := $(src)/../scripts/gen_config.pl
$(obj)/mars_config.h: $(src)/Kconfig $(GEN_CONFIG_SCRIPT)
$(Q)$(kecho) "MARS: Generating $@"
$(Q)set -e; \
if [ ! -x $(GEN_CONFIG_SCRIPT) ]; then \
$(kecho) "MARS: cannot execute script $(GEN_CONFIG_SCRIPT)"; \
/bin/false; \
fi; \
cat $< | $(GEN_CONFIG_SCRIPT) > $@;