2010-06-14 14:27:40 +00:00
|
|
|
#
|
|
|
|
# Makefile for MARS
|
|
|
|
#
|
|
|
|
|
2013-04-17 09:04:52 +00:00
|
|
|
KBUILD_CFLAGS += -fdelete-null-pointer-checks
|
|
|
|
|
2016-03-03 11:42:41 +00:00
|
|
|
# remove_this
|
|
|
|
# The following is 1&1 specific. Don't use anywhere else.
|
|
|
|
ifneq ($(KBUILD_EXTMOD),)
|
|
|
|
CONFIG_MARS := m
|
|
|
|
# mars_config.h is generated by a simple Kconfig parser (gen_config.pl)
|
|
|
|
# at build time.
|
|
|
|
# It does not respect any Kconfig dependencies.
|
|
|
|
# Therefore, it is unsafe. Use at your own risk!
|
|
|
|
# It is ONLY used for out-of-tree builds.
|
|
|
|
#
|
|
|
|
extra-y += mars_config.h
|
|
|
|
GEN_CONFIG_SCRIPT := $(src)/../scripts/gen_config.pl
|
|
|
|
$(obj)/mars_config.h: $(obj)/buildtag.h
|
|
|
|
$(obj)/mars_config.h: $(src)/Kconfig $(GEN_CONFIG_SCRIPT)
|
|
|
|
$(Q)$(kecho) "MARS: using compiler $($(CC) --version | head -1)"
|
|
|
|
$(CC) -v
|
|
|
|
$(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) > $@;
|
|
|
|
cat $@;
|
|
|
|
endif
|
|
|
|
# end_remove_this
|
|
|
|
|
|
|
|
obj-$(CONFIG_MARS) += mars.o
|
|
|
|
|
2012-01-30 11:54:56 +00:00
|
|
|
mars-objs := \
|
2013-07-18 10:45:34 +00:00
|
|
|
lamport.o \
|
2012-01-30 11:54:56 +00:00
|
|
|
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 \
|
2013-01-23 11:21:22 +00:00
|
|
|
lib_mapfree.o \
|
2012-01-30 11:54:56 +00:00
|
|
|
mars_net.o \
|
|
|
|
mars_server.o \
|
|
|
|
mars_client.o \
|
|
|
|
mars_aio.o \
|
|
|
|
mars_sio.o \
|
|
|
|
mars_bio.o \
|
2020-04-25 13:38:31 +00:00
|
|
|
mars_gate.o \
|
2012-01-30 11:54:56 +00:00
|
|
|
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 \
|
2016-03-03 08:31:11 +00:00
|
|
|
sy_old/mars_main.o
|
2011-08-25 10:16:32 +00:00
|
|
|
|
2011-03-22 14:36:26 +00:00
|
|
|
ifdef CONFIG_DEBUG_KERNEL
|
2012-01-30 11:54:56 +00:00
|
|
|
|
2011-03-22 14:36:26 +00:00
|
|
|
KBUILD_CFLAGS += -fno-inline-functions -fno-inline-small-functions -fno-inline-functions-called-once
|
2012-01-30 11:54:56 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
2013-04-09 13:35:00 +00:00
|
|
|
#
|
2014-08-07 13:25:04 +00:00
|
|
|
# buildtag.h should be regenerated in every build.
|
|
|
|
#
|
|
|
|
# The version is determined by the following preference order:
|
|
|
|
# 1) environment variable $MARSVERSION
|
|
|
|
# 2) when git is available: git describe --tags
|
|
|
|
# 3) if a file 'DISTVERSION' exists (out-of-tree tarball), use its content.
|
|
|
|
# 4) otherwise "no-buildtag-available"
|
2013-04-09 13:35:00 +00:00
|
|
|
#
|
|
|
|
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! */";\
|
2013-04-09 13:35:00 +00:00
|
|
|
cd $(src); \
|
2014-08-07 13:25:04 +00:00
|
|
|
if [ "$$MARSVERSION" != "" ]; then \
|
|
|
|
BUILDTAG="$$MARSVERSION"; \
|
2014-04-29 05:58:57 +00:00
|
|
|
elif git describe --tags >/dev/null 2>&1; then \
|
|
|
|
BUILDTAG="$$(git describe --tags)"; \
|
2014-08-07 13:25:04 +00:00
|
|
|
elif [ -e DISTVERSION ]; then \
|
|
|
|
BUILDTAG=$$(cat DISTVERSION); \
|
2013-04-09 13:35:00 +00:00
|
|
|
else \
|
|
|
|
BUILDTAG="no-buildtag-available"; \
|
|
|
|
fi; \
|
|
|
|
/bin/echo -e "#define BUILDTAG \"$$BUILDTAG\"";\
|
2014-05-12 11:10:45 +00:00
|
|
|
/bin/echo -e "#define BUILDHOST \"$$USER@`hostname`\"";\
|
2011-10-17 15:01:15 +00:00
|
|
|
/bin/echo -e "#define BUILDDATE \"$$(date '+%F %T')\""
|
2014-08-07 13:25:04 +00:00
|
|
|
cat $@;
|