Blame Makefile.in

8be377
PACKAGE 		= @package@
8be377
NICKNAME 		= @nickname@
8be377
PROJECT_DIR 		= @project_dir@
8be377
SOURCE_DIR 		= @source_dir@
8be377
GIT_REFERENCE_INDEX	= @git_reference_index@
8be377
CUSTOM_INSTALL_HEADERS  = @custom_install_headers@
8be377
AVOID_VERSION		= @avoid_version@
8be377
8be377
BUILD 			= @build@
8be377
HOST 			= @host@
8be377
TARGET 			= @target@
8be377
ARCH 			= @arch@
8be377
COMPILER 		= @compiler@
8be377
TOOLCHAIN		= @toolchain@
8be377
SYSROOT 		= @sysroot@
8be377
CROSS_COMPILE 		= @cross_compile@
8be377
SHELL 			= @shell@
8be377
8be377
CFLAGS_COMMON 		= @cflags_common@
8be377
CFLAGS_DEBUG 		= @cflags_debug@
8be377
CFLAGS_CMDLINE 		= @cflags_cmdline@
8be377
CFLAGS_CONFIG 		= @cflags_config@
8be377
CFLAGS_SYSROOT 		= @cflags_sysroot@
8be377
CFLAGS_OS		= @cflags_os@
8be377
CFLAGS_SITE		= @cflags_site@
8be377
CFLAGS_PATH 		= @cflags_path@
8be377
CFLAGS_STRICT 		= @cflags_strict@
8be377
CFLAGS_UTIL 		= @cflags_util@
8be377
CFLAGS_LAST 		= @cflags_last@
8be377
CFLAGS_ONCE 		= @cflags_once@
8be377
8be377
LDFLAGS_COMMON 		= @ldflags_common@
8be377
LDFLAGS_DEBUG 		= @ldflags_debug@
8be377
LDFLAGS_CMDLINE 	= @ldflags_cmdline@
8be377
LDFLAGS_CONFIG 		= @ldflags_config@
8be377
LDFLAGS_SYSROOT 	= @ldflags_sysroot@
8be377
LDFLAGS_PATH 		= @ldflags_path@
8be377
LDFLAGS_STRICT 		= @ldflags_strict@
8be377
LDFLAGS_UTIL 		= @ldflags_util@
8be377
LDFLAGS_LAST 		= @ldflags_last@
8be377
LDFLAGS_ONCE 		= @ldflags_once@
8be377
8be377
PE_SUBSYSTEM 		= @pe_subsystem@
8be377
PE_IMAGE_BASE 		= @pe_image_base@
8be377
PE_CONFIG_DEFS  	= @pe_config_defs@
8be377
8be377
ELF_EH_FRAME 		= @elf_eh_frame@
8be377
ELF_HASH_STYLE 		= @elf_hash_style@
8be377
ELF_CONFIG_DEFS 	= @elf_config_defs@
8be377
8be377
PREFIX 			= @prefix@
8be377
EXEC_PREFIX 		= @exec_prefix@
8be377
BINDIR 			= @bindir@
8be377
LIBDIR 			= @libdir@
8be377
INCLUDEDIR 		= @includedir@
8be377
MANDIR 			= @mandir@
8be377
DOCDIR 			= @docdir@
8be377
LIBEXECDIR 		= @libexecdir@
8be377
8be377
NATIVE_CC 		= @native_cc@
8be377
NATIVE_OS 		= @native_os@
8be377
NATIVE_OS_BITS 		= @native_os_bits@
8be377
NATIVE_OS_UNDERSCORE	= @native_os_underscore@
8be377
8be377
USER_CC                 = @user_cc@
8be377
USER_CPP                = @user_cpp@
8be377
USER_CXX                = @user_cxx@
8be377
8be377
ALL_SHARED              = @all_shared@
8be377
ALL_STATIC              = @all_static@
8be377
DISABLE_FRONTEND	= @disable_frontend@
8be377
DISABLE_SHARED          = @disable_shared@
8be377
DISABLE_STATIC          = @disable_static@
8be377
8be377
all:
8be377
install:
8be377
shared:
8be377
static:
8be377
8be377
install-extras:
8be377
install-app-extras:
8be377
8be377
include $(PROJECT_DIR)/sysinfo/host/$(HOST).mk
8be377
include $(PROJECT_DIR)/sysinfo/compiler/$(COMPILER).mk
8be377
include $(PROJECT_DIR)/sysinfo/toolchain/$(TOOLCHAIN).mk
881324
include $(PROJECT_DIR)/sysinfo/os/$(OS).mk
8be377
8be377
include $(PROJECT_DIR)/project/osforce.mk
8be377
8be377
include $(PROJECT_DIR)/sofort/defs.mk
8be377
include $(PROJECT_DIR)/sofort/version.mk
8be377
include $(PROJECT_DIR)/sofort/custom.mk
8be377
8be377
include $(PROJECT_DIR)/project/tree.mk
8be377
include $(PROJECT_DIR)/project/depends.mk
8be377
include $(PROJECT_DIR)/project/headers.mk
8be377
include $(PROJECT_DIR)/project/common.mk
8be377
include $(PROJECT_DIR)/project/arch.mk
8be377
include $(PROJECT_DIR)/project/extras.mk
8be377
include $(PROJECT_DIR)/project/overrides.mk
8be377
8be377
8be377
8be377
$(APP_SRCS:%.c=%.o): CFLAGS_STATIC = $(CFLAGS_APP)
8be377
8be377
src/%.lo: 	$(SOURCE_DIR)/src/%.c $(ALL_HEADERS) host.tag tree.tag
8be377
		$(CC) -c -o $@ $< $(CFLAGS_SHARED)
8be377
8be377
src/%.o: 	$(SOURCE_DIR)/src/%.c $(ALL_HEADERS) host.tag tree.tag
8be377
		$(CC) -c -o $@ $< $(CFLAGS_STATIC)
8be377
8be377
lib/%$(OS_LIB_SUFFIX)$(VER_XYZ):
8be377
		$(CC) -shared -o $@ $^ $(LDFLAGS_SHARED)
8be377
8be377
lib/%$(OS_ARCHIVE_EXT):
8be377
		rm -f $@
8be377
		$(AR) rcs $@ $^
8be377
8be377
8be377
8be377
all:		package-shared package-static app
8be377
8be377
install:	package-install-app
8be377
install:	package-install-extras
8be377
install:	install-libs
8be377
8be377
app:		app-tag
8be377
8be377
app.tag:
8be377
		cp $(PACKAGE_APP) $(APP)
8be377
		touch app.tag
8be377
8be377
install-libs:	package-install-shared
8be377
install-libs:	package-install-static
8be377
8be377
install-headers-default:
8be377
		mkdir -p $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)
8be377
		cp $(API_HEADERS) $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)
8be377
8be377
install-shared:	shared install-lib install-implib
8be377
install-shared: package-install-soname package-install-solink
8be377
install-shared: install-headers
8be377
8be377
install-lib:	shared
8be377
		mkdir -p $(DESTDIR)$(LIBDIR)
8be377
		cp $(SHARED_LIB) $(DESTDIR)$(LIBDIR)
8be377
8be377
install-static:	static install-headers
8be377
		mkdir -p $(DESTDIR)$(LIBDIR)
8be377
		cp $(STATIC_LIB) $(DESTDIR)$(LIBDIR)
8be377
8be377
install-app:	app install-app-extras
8be377
		mkdir -p $(DESTDIR)$(BINDIR)
8be377
		cp $(APP) $(DESTDIR)$(BINDIR)
8be377
8be377
install-static-app:	static-app install-app-extras
8be377
			mkdir -p $(DESTDIR)$(BINDIR)
8be377
			cp $(STATIC_APP) $(DESTDIR)$(BINDIR)/$(NICKNAME)$(OS_APP_SUFFIX)
8be377
8be377
8be377
8be377
shared:		shared-lib implib
8be377
shared:		package-shared-soname package-shared-solink
8be377
8be377
static:		static-lib
8be377
8be377
shared-lib:	shared-objs $(SHARED_LIB)
8be377
8be377
shared-soname:	shared-lib $(SHARED_SONAME)
8be377
8be377
shared-solink:	shared-lib $(SHARED_SOLINK)
8be377
8be377
static-lib:	static-objs $(STATIC_LIB)
8be377
8be377
8be377
8be377
default-app:	version.tag static-objs $(DEFAULT_APP)
8be377
8be377
shared-app:	version.tag shared $(SHARED_APP)
8be377
8be377
static-app:	version.tag static-objs $(STATIC_APP)
8be377
8be377
8be377
8be377
shared-objs:	dirs $(SHARED_OBJS)
8be377
8be377
static-objs:	dirs $(STATIC_OBJS)
8be377
8be377
app-objs:	dirs $(APP_OBJS)
8be377
8be377
8be377
8be377
$(SHARED_LIB):	$(SHARED_OBJS)
8be377
8be377
$(STATIC_LIB):	$(STATIC_OBJS)
8be377
8be377
$(APP):		$(PACKAGE_APP)
8be377
8be377
$(DEFAULT_APP):	$(STATIC_OBJS) $(APP_OBJS)
8be377
		rm -f app.tag
8be377
		$(CC) -o $@ $^ $(LDFLAGS_APP)
8be377
8be377
$(SHARED_APP):	$(SHARED_LIB) $(APP_OBJS)
8be377
		rm -f app.tag
8be377
		$(CC) -o $@ $(APP_OBJS) -l$(PACKAGE) $(LDFLAGS_SHARED)
8be377
8be377
$(STATIC_APP):	$(STATIC_OBJS) $(APP_OBJS)
8be377
		rm -f app.tag
8be377
		$(CC) -static -o $@ $^ $(LDFLAGS_STATIC)
8be377
8be377
8be377
dirs: 		dirs.tag
8be377
8be377
dirs.tag:
8be377
		mkdir -p bin
8be377
		mkdir -p lib
8be377
		touch dirs.tag
8be377
8be377
host.tag:	Makefile
8be377
		$(PROJECT_DIR)/sysinfo/host/host.sh --compiler="$(CC)" --cflags="$(CFLAGS)"
8be377
		touch host.tag
8be377
8be377
version.tag:	$(GIT_REFERENCE_INDEX)
8be377
		$(PROJECT_DIR)/sysinfo/version.sh	\
8be377
			-s $(SOURCE_DIR)		\
8be377
			-o build/$(PACKAGE)_version.h	\
8be377
			-p $(PACKAGE)
8be377
		touch version.tag
8be377
8be377
distclean:	clean
8be377
		rm -f Makefile
8be377
8be377
clean:		clean-implib
8be377
		rm -f tree.tag
8be377
		rm -f dirs.tag
8be377
		rm -f host.tag
8be377
		rm -f version.tag
8be377
		rm -f app.tag
8be377
		rm -f $(SHARED_OBJS)
8be377
		rm -f $(STATIC_OBJS)
8be377
		rm -f $(APP_OBJS)
8be377
		rm -f $(SHARED_LIB)
8be377
		rm -f $(SHARED_SONAME)
8be377
		rm -f $(SHARED_SOLINK)
8be377
		rm -f $(STATIC_LIB)
8be377
		rm -f $(APP)
8be377
		rm -f $(DEFAULT_APP)
8be377
		rm -f $(SHARED_APP)
8be377
		rm -f $(STATIC_APP)
8be377
8be377
8be377
.display:	.display-project .display-env .display-tools .display-flags \
8be377
		.display-pe .display-elf .display-dirs .display-build \
8be377
		.display-config
8be377
8be377
.conf:		PAGER ?= less
8be377
.conf:
8be377
		$(MAKE) .display | $(PAGER)
8be377
8be377
.display-project:
8be377
		@echo PACKAGE:'                '$(PACKAGE)
8be377
		@echo NICKNAME:'               '$(NICKNAME)
8be377
		@echo PROJECT_DIR:'            '$(PROJECT_DIR)
8be377
		@echo SOURCE_DIR:'             '$(SOURCE_DIR)
8be377
		@echo BUILD_DIR:'              '$(CURDIR)
8be377
		@echo
8be377
8be377
.display-env:
8be377
		@echo BUILD:'                  '$(BUILD)
8be377
		@echo HOST:'                   '$(HOST)
8be377
		@echo TARGET:'                 '$(TARGET)
8be377
		@echo ARCH:'                   '$(ARCH)
8be377
		@echo COMPILER:'               '$(COMPILER)
8be377
		@echo TOOLCHAIN:'              '$(TOOLCHAIN)
8be377
		@echo SYSROOT:'                '$(SYSROOT)
8be377
		@echo CROSS_COMPILE:'          '$(CROSS_COMPILE)
8be377
		@echo SHELL:'                  '$(SHELL)
8be377
		@echo
8be377
8be377
.display-tools:
8be377
		@echo CC:'                     '$(CC)
8be377
		@echo CPP:'                    '$(CPP)
8be377
		@echo CXX:'                    '$(CXX)
8be377
		@echo
8be377
		@echo AS:'                     '$(AS)
8be377
		@echo AR:'                     '$(AR)
8be377
		@echo LD:'                     '$(LD)
8be377
		@echo NM:'                     '$(NM)
8be377
		@echo OBJDUMP:'                '$(OBJDUMP)
8be377
		@echo RANLIB:'                 '$(RANLIB)
8be377
		@echo SIZE:'                   '$(SIZE)
8be377
		@echo STRIP:'                  '$(STRIP)
8be377
		@echo STRINGS:'                '$(STRINGS)
8be377
		@echo
8be377
		@echo ADDR2LINE:'              '$(ADDR2LINE)
8be377
		@echo COV:'                    '$(COV)
8be377
		@echo CXXFILT'                 '$(CXXFILT)
8be377
		@echo ELFEDIT:'                '$(ELFEDIT)
8be377
		@echo OBJCOPY:'                '$(OBJCOPY)
8be377
		@echo READELF:'                '$(READELF)
8be377
		@echo
8be377
8be377
.display-flags:
8be377
		@echo CFLAGS_COMMON:'          '$(CFLAGS_COMMON)
8be377
		@echo CFLAGS_DEBUG:'           '$(CFLAGS_DEBUG)
8be377
		@echo CFLAGS_VERSION:'         '$(CFLAGS_VERSION)
8be377
		@echo CFLAGS_CMDLINE:'         '$(CFLAGS_CMDLINE)
8be377
		@echo CFLAGS_CONFIG:'          '$(CFLAGS_CONFIG)
8be377
		@echo CFLAGS_SYSROOT:'         '$(CFLAGS_SYSROOT)
8be377
		@echo CFLAGS_OS:'              '$(CFLAGS_OS)
8be377
		@echo CFLAGS_SITE:'            '$(CFLAGS_SITE)
8be377
		@echo CFLAGS_PATH:'            '$(CFLAGS_PATH)
8be377
		@echo CFLAGS_STRICT:'          '$(CFLAGS_STRICT)
8be377
		@echo CFLAGS_UTIL:'            '$(CFLAGS_UTIL)
8be377
		@echo CFLAGS_LAST:'            '$(CFLAGS_LAST)
8be377
		@echo CFLAGS_ONCE:'            '$(CFLAGS_ONCE)
8be377
		@echo
8be377
		@echo LDFLAGS_COMMON:'         '$(LDFLAGS_COMMON)
8be377
		@echo LDFLAGS_DEBUG:'          '$(LDFLAGS_DEBUG)
8be377
		@echo LDFLAGS_CMDLINE:'        '$(LDFLAGS_CMDLINE)
8be377
		@echo LDFLAGS_CONFIG:'         '$(LDFLAGS_CONFIG)
8be377
		@echo LDFLAGS_SYSROOT:'        '$(LDFLAGS_SYSROOT)
8be377
		@echo LDFLAGS_PATH:'           '$(LDFLAGS_PATH)
8be377
		@echo LDFLAGS_STRICT:'         '$(LDFLAGS_STRICT)
8be377
		@echo LDFLAGS_UTIL:'           '$(LDFLAGS_UTIL)
8be377
		@echo LDFLAGS_LAST:'           '$(LDFLAGS_LAST)
8be377
		@echo LDFLAGS_ONCE:'           '$(LDFLAGS_ONCE)
8be377
		@echo
8be377
8be377
.display-pe:
8be377
		@echo PE_SUBSYSTEM:'           '$(PE_SUBSYSTEM)
8be377
		@echo PE_IMAGE_BASE:'          '$(PE_IMAGE_BASE)
8be377
		@echo PE_CONFIG_DEFS:'         '$(PE_CONFIG_DEFS)
8be377
		@echo
8be377
8be377
.display-elf:
8be377
		@echo ELF_EH_FRAME:'           '$(ELF_EH_FRAME)
8be377
		@echo ELF_HASH_STYLE:'         '$(ELF_HASH_STYLE)
8be377
		@echo ELF_CONFIG_DEFS:'        '$(ELF_CONFIG_DEFS)
8be377
		@echo
8be377
8be377
.display-dirs:
8be377
		@echo PREFIX:'                 '$(PREFIX)
8be377
		@echo EXEC_PREFIX:'            '$(EXEC_PREFIX)
8be377
		@echo BINDIR:'                 '$(BINDIR)
8be377
		@echo LIBDIR:'                 '$(LIBDIR)
8be377
		@echo INCLUDEDIR:'             '$(INCLUDEDIR)
8be377
		@echo MANDIR:'                 '$(MANDIR)
8be377
		@echo DOCDIR:'                 '$(DOCDIR)
8be377
		@echo LIBEXECDIR:'             '$(LIBEXECDIR)
8be377
		@echo
8be377
8be377
.display-build:
8be377
		@echo NATIVE_CC:'              '$(NATIVE_CC)
8be377
		@echo NATIVE_OS:'              '$(NATIVE_OS)
8be377
		@echo NATIVE_OS_BITS:'         '$(NATIVE_OS_BITS)
8be377
		@echo NATIVE_OS_UNDERSCORE:'   '$(NATIVE_OS_UNDERSCORE)
8be377
		@echo
8be377
		@echo USER_CC:'                '$(USER_CC)
8be377
		@echo USER_CPP:'               '$(USER_CPP)
8be377
		@echo USER_CXX:'               '$(USER_CXX)
8be377
		@echo
8be377
8be377
.display-config:
8be377
		@echo ALL_SHARED:'             '$(ALL_SHARED)
8be377
		@echo ALL_STATIC:'             '$(ALL_STATIC)
8be377
		@echo DISABLE_FRONTEND:'       '$(DISABLE_FRONTEND)
8be377
		@echo DISABLE_SHARED:'         '$(DISABLE_SHARED)
8be377
		@echo DISABLE_STATIC:'         '$(DISABLE_STATIC)
8be377
8be377
.display-host:
8be377
		@$(CC) $(CFLAGS) -dumpmachine
8be377
8be377
.display-cc:
8be377
		@echo $(CC)
8be377
8be377
.display-cflags:
8be377
		@echo $(CFLAGS)
8be377
8be377
8be377
.PHONY:		all install shared static app \
8be377
		package-app \
8be377
		shared-objs shared-lib \
8be377
		shared-soname shared-solink \
8be377
		package-shared-soname package-shared-solink \
8be377
		static-objs static-lib \
8be377
		default-app shared-app static-app \
8be377
		install-shared install-static \
8be377
		install-soname install-solink \
8be377
		package-install-soname package-install-solink \
8be377
		install-headers install-app \
8be377
		install-headers-default install-headers-custom \
8be377
		clean distclean clean-implib version \
8be377
		.display .conf \
8be377
		.display-project .display-env .display-tools .display-flags \
8be377
		.display-pe .display-elf .display-dirs .display-build \
8be377
		implib implib-ver implib-soname implib-solink \
8be377
		install-implib install-implib-ver \
8be377
		install-implib-soname install-implib-solink