mirror of
https://github.com/schoebel/mars
synced 2025-02-26 17:40:43 +00:00
This is a preparation of instance orientation. Fully dynamic separation not yet done. Currently the separation is at linker level only. But the different parts may go to different locations later.
118 lines
2.9 KiB
Makefile
118 lines
2.9 KiB
Makefile
#
|
|
# Makefile for MARS
|
|
#
|
|
|
|
# remove_this
|
|
ifndef CONFIG_MARS
|
|
# 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.
|
|
#
|
|
CONFIG_MARS_BIGMODULE := m
|
|
CONFIG_MARS_NET_COMPAT := y
|
|
obj-$(CONFIG_MARS_BIGMODULE) += mars.o
|
|
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
|
|
|
|
KBUILD_CFLAGS += -fdelete-null-pointer-checks
|
|
|
|
mars-objs := \
|
|
lamport.o \
|
|
brick_say.o \
|
|
brick_mem.o \
|
|
brick.o \
|
|
mars_generic.o \
|
|
lib_log.o \
|
|
lib_rank.o \
|
|
lib_limiter.o \
|
|
lib_timing.o \
|
|
lib_mapfree.o \
|
|
mars_net.o \
|
|
mars_server_strategy.o \
|
|
mars_server.o \
|
|
mars_client.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 \
|
|
sy_old/mars_light.o
|
|
|
|
## remove_this
|
|
|
|
ifdef CONFIG_MARS_NET_COMPAT
|
|
mars-objs += mars_net_compat.o
|
|
endif
|
|
|
|
mars-objs += \
|
|
mars_aio.o \
|
|
|
|
ifdef CONFIG_MARS_DEBUG
|
|
|
|
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 \
|
|
|
|
endif
|
|
|
|
#
|
|
# 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"
|
|
#
|
|
extra-y += buildtag.h
|
|
$(obj)/buildtag.h: $(patsubst $(obj)/buildtag.h,,$(wildcard $(obj)/*.[ch])) $(obj)/*/*.[ch]
|
|
$(Q)$(kecho) "MARS: Generating $@"
|
|
$(Q)set -e; \
|
|
exec > $@;\
|
|
/bin/echo -e "/* Automatically generated -- DO NOT EDIT! */";\
|
|
cd $(src); \
|
|
if [ "$$MARSVERSION" != "" ]; then \
|
|
BUILDTAG="$$MARSVERSION"; \
|
|
elif git describe --tags >/dev/null 2>&1; then \
|
|
BUILDTAG="$$(git describe --tags)"; \
|
|
elif [ -e DISTVERSION ]; then \
|
|
BUILDTAG=$$(cat DISTVERSION); \
|
|
else \
|
|
BUILDTAG="no-buildtag-available"; \
|
|
fi; \
|
|
/bin/echo -e "#define BUILDTAG \"$$BUILDTAG\"";\
|
|
/bin/echo -e "#define BUILDHOST \"$$USER@`hostname`\"";\
|
|
/bin/echo -e "#define BUILDDATE \"$$(date '+%F %T')\""
|
|
cat $@;
|
|
|
|
## end_remove_this
|