Blame Makefile.in

51bc52
# Makefile.in: primary common build logic.
51bc52
# this file is covered by COPYING.SOFORT.
51bc52
3ae283
PACKAGE 		= @package@
3ae283
NICKNAME 		= @nickname@
3ae283
PROJECT_DIR 		= @project_dir@
3ae283
SOURCE_DIR 		= @source_dir@
3ae283
GIT_REFERENCE_INDEX	= @git_reference_index@
3ae283
CUSTOM_INSTALL_HEADERS  = @custom_install_headers@
3ae283
AVOID_VERSION		= @avoid_version@
3ae283
3ae283
PKGNAME			= @pkgname@
3ae283
PKGDESC			= @pkgdesc@
3ae283
PKGUSRC			= @pkgusrc@
3ae283
PKGREPO			= @pkgrepo@
3ae283
PKGPSRC			= @pkgpsrc@
3ae283
PKGDURL			= @pkgdurl@
c27990
PKGBUGS			= @pkgbugs@
c27990
PKGHOME			= @pkghome@
3ae283
PKGDEFS			= @pkgdefs@
3ae283
PKGLIBS			= @pkglibs@
3ae283
8524cb
SRCINFO			= @srcinfo@
8524cb
SRCSITE			= @srcsite@
8524cb
8524cb
PGPRKEY			= @pgprkey@
8524cb
PGPSKEY			= @pgpskey@
8524cb
884c97
RAWBALL			= @rawball@
884c97
RAWBALL_URL		= @rawball_url@
884c97
RAWBALL_SHA256		= @rawball_sha256@
884c97
MODBALL			= @modball@
884c97
MODBALL_URL		= @modball_url@
884c97
MODBALL_SHA256		= @modball_sha256@
884c97
SRCBALL			= @srcball@
884c97
SRCBALL_URL		= @srcball_url@
884c97
SRCBALL_SHA256		= @srcball_sha256@
884c97
3ae283
BUILD 			= @build@
3ae283
HOST 			= @host@
3ae283
CCHOST 			= @cchost@
3ae283
CFGHOST 		= @cfghost@
3ae283
TARGET 			= @target@
3ae283
ARCH 			= @arch@
3ae283
COMPILER 		= @compiler@
3ae283
TOOLCHAIN		= @toolchain@
3ae283
SYSROOT 		= @sysroot@
3ae283
CROSS_COMPILE 		= @cross_compile@
3ae283
SHELL 			= @shell@
3ae283
3ae283
PREFIX 			= @prefix@
3ae283
EXEC_PREFIX 		= @exec_prefix@
3ae283
BINDIR 			= @bindir@
3ae283
SBINDIR 		= @sbindir@
3ae283
LIBDIR 			= @libdir@
3ae283
INCLUDEDIR 		= @includedir@
3ae283
OLDINCLUDEDIR 		= @oldincludedir@
3ae283
MANDIR 			= @mandir@
3ae283
DOCDIR 			= @docdir@
3ae283
LIBEXECDIR 		= @libexecdir@
3ae283
3ae283
SYSCONFDIR		= @sysconfdir@
3ae283
SHAREDSTATEDIR		= @sharedstatedir@
3ae283
LOCALSTATEDIR		= @localstatedir@
3ae283
RUNSTATEDIR		= @runstatedir@
3ae283
DATAROOTDIR		= @datarootdir@
3ae283
DATADIR			= @datadir@
3ae283
INFODIR			= @infodir@
3ae283
LOCALEDIR		= @localedir@
3ae283
HTMLDIR			= @htmldir@
3ae283
DVIDIR			= @dvidir@
3ae283
PDFDIR			= @pdfdir@
3ae283
PSDIR			= @psdir@
3ae283
3ae283
CFLAGS_COMMON 		+= @cflags_common@
3ae283
CFLAGS_DEBUG 		+= @cflags_debug@
3ae283
CFLAGS_CMDLINE 		+= @cflags_cmdline@
3ae283
CFLAGS_CONFIG 		+= @cflags_config@
3ae283
CFLAGS_SYSROOT 		+= @cflags_sysroot@
3ae283
CFLAGS_OS		+= @cflags_os@
3ae283
CFLAGS_SITE		+= @cflags_site@
3ae283
CFLAGS_PATH 		+= @cflags_path@
3ae283
CFLAGS_STRICT 		+= @cflags_strict@
3ae283
CFLAGS_UTIL 		+= @cflags_util@
3ae283
CFLAGS_LAST 		+= @cflags_last@
3ae283
CFLAGS_ONCE 		+= @cflags_once@
3ae283
3ae283
LDFLAGS_COMMON 		+= @ldflags_common@
3ae283
LDFLAGS_DEBUG 		+= @ldflags_debug@
3ae283
LDFLAGS_CMDLINE 	+= @ldflags_cmdline@
3ae283
LDFLAGS_CONFIG 		+= @ldflags_config@
3ae283
LDFLAGS_SYSROOT 	+= @ldflags_sysroot@
3ae283
LDFLAGS_PATH 		+= @ldflags_path@
3ae283
LDFLAGS_STRICT 		+= @ldflags_strict@
3ae283
LDFLAGS_UTIL 		+= @ldflags_util@
3ae283
LDFLAGS_LAST 		+= @ldflags_last@
3ae283
LDFLAGS_ONCE 		+= @ldflags_once@
3ae283
3ae283
USER_CC                 = @user_cc@
3ae283
USER_CPP                = @user_cpp@
3ae283
USER_CXX                = @user_cxx@
3ae283
3ae283
NATIVE_HOST		= @native_host@
3ae283
NATIVE_CFGHOST		= @native_cfghost@
3ae283
NATIVE_CFLAGS		= @native_cflags@
3ae283
NATIVE_LDFLAGS		= @native_ldflags@
3ae283
3ae283
ALL_SHARED              = @all_shared@
3ae283
ALL_STATIC              = @all_static@
3ae283
DISABLE_FRONTEND	= @disable_frontend@
3ae283
DISABLE_SHARED          = @disable_shared@
3ae283
DISABLE_STATIC          = @disable_static@
3ae283
3ae283
USE_CUSTOM_CFGDEFS      = @use_custom_cfgdefs@
3ae283
USE_CUSTOM_USRDEFS      = @use_custom_usrdefs@
3ae283
a9ff1f
SHARED_LIB_CMD          = @shared_lib_cmd@
a9ff1f
SHARED_LIB_LDFLAGS      = @shared_lib_ldflags@
a9ff1f
1c36b7
.cflags-host:
1c36b7
	@printf '%s' "$(CFLAGS)"
1c36b7
1c36b7
.cflags-native:
1c36b7
	@printf '%s' "$(NATIVE_CFLAGS)"
1c36b7
8beafd
.SUFFIXES:
8beafd
3ae283
all:
3ae283
install:
3ae283
shared:
3ae283
static:
3ae283
3ae283
install-extras:
3ae283
install-app-extras:
3ae283
3ae283
include ./ccenv/host.mk
3ae283
include ./ccenv/native.mk
3ae283
3ae283
include ./cfgdefs.mk
3ae283
include ./usrdefs.mk
3ae283
3ae283
include $(PROJECT_DIR)/sofort/core/defs.mk
3ae283
include $(PROJECT_DIR)/sofort/core/pkgconf.mk
3ae283
include $(PROJECT_DIR)/sofort/core/version.mk
3ae283
include $(PROJECT_DIR)/sofort/core/flavor.mk
3ae283
3ae283
include $(PROJECT_DIR)/project/osforce.mk
3ae283
include $(PROJECT_DIR)/project/tree.mk
3ae283
include $(PROJECT_DIR)/project/depends.mk
3ae283
include $(PROJECT_DIR)/project/headers.mk
3ae283
include $(PROJECT_DIR)/project/common.mk
3ae283
include $(PROJECT_DIR)/project/arch.mk
3ae283
include $(PROJECT_DIR)/project/extras.mk
3ae283
include $(PROJECT_DIR)/project/overrides.mk
3ae283
3ae283
3ae283
$(APP_SRCS:%.c=%.o): CFLAGS_STATIC = $(CFLAGS_APP)
3ae283
3ae283
src/%.lo: 	$(SOURCE_DIR)/src/%.c $(ALL_HEADERS) host.tag tree.tag
3ae283
		$(CC) -c -o $@ $< $(CFLAGS_SHARED)
3ae283
3ae283
src/%.o: 	$(SOURCE_DIR)/src/%.c $(ALL_HEADERS) host.tag tree.tag
3ae283
		$(CC) -c -o $@ $< $(CFLAGS_STATIC)
3ae283
3ae283
lib/%$(OS_LIB_PREFIXED_SUFFIX)$(VER_XYZ)$(OS_LIB_SUFFIXED_SUFFIX):
a9ff1f
		$(SHARED_LIB_CMD) $@ $^ $(SHARED_LIB_LDFLAGS)
3ae283
0f3a67
lib/%$(OS_ARCHIVE_EXT):
0f3a67
		mkdir -p lib
3ae283
		rm -f $@
3ae283
		$(AR) rcs $@ $^
3ae283
3ae283
3ae283
3ae283
all:		package-shared package-static app
3ae283
3ae283
install:	package-install-app
3ae283
install:	package-install-extras
3ae283
install:	install-libs
3ae283
3ae283
app:		app-tag
3ae283
3ae283
app.tag:
3ae283
		cp $(PACKAGE_APP) $(APP)
3ae283
		touch app.tag
3ae283
3ae283
install-libs:	package-install-shared
3ae283
install-libs:	package-install-static
3ae283
3ae283
install-headers-default:
3ae283
		mkdir -p $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)
3ae283
		cp $(API_HEADERS) $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)
3ae283
3ae283
install-shared:	shared install-lib install-implib
3ae283
install-shared: package-install-soname package-install-solink
3ae283
install-shared: install-headers
3ae283
3ae283
install-lib:	shared
3ae283
		mkdir -p $(DESTDIR)$(LIBDIR)
3ae283
		cp $(SHARED_LIB) $(DESTDIR)$(LIBDIR)
3ae283
3ae283
install-static:	static install-headers
3ae283
		mkdir -p $(DESTDIR)$(LIBDIR)
3ae283
		cp $(STATIC_LIB) $(DESTDIR)$(LIBDIR)
3ae283
3ae283
install-app:	app install-app-extras
3ae283
		mkdir -p $(DESTDIR)$(BINDIR)
3ae283
		cp $(APP) $(DESTDIR)$(BINDIR)
3ae283
3ae283
install-static-app:	static-app install-app-extras
3ae283
			mkdir -p $(DESTDIR)$(BINDIR)
3ae283
			cp $(STATIC_APP) $(DESTDIR)$(BINDIR)/$(NICKNAME)$(OS_APP_SUFFIX)
3ae283
3ae283
3ae283
3ae283
shared:		shared-lib implib
3ae283
shared:		package-shared-soname package-shared-solink
3ae283
3ae283
static:		static-lib
3ae283
3ae283
shared-lib:	shared-objs $(SHARED_LIB)
3ae283
3ae283
shared-soname:	shared-lib $(SHARED_SONAME)
3ae283
3ae283
shared-solink:	shared-lib $(SHARED_SOLINK)
3ae283
3ae283
static-lib:	static-objs $(STATIC_LIB)
3ae283
3ae283
3ae283
3ae283
default-app:	version.tag static-objs $(DEFAULT_APP)
3ae283
3ae283
shared-app:	version.tag shared $(SHARED_APP)
3ae283
3ae283
static-app:	version.tag static-objs $(STATIC_APP)
3ae283
3ae283
3ae283
3ae283
shared-objs:	dirs $(SHARED_OBJS)
3ae283
3ae283
static-objs:	dirs $(STATIC_OBJS)
3ae283
3ae283
app-objs:	dirs $(APP_OBJS)
3ae283
3ae283
3ae283
3ae283
$(SHARED_LIB):	$(SHARED_OBJS)
3ae283
$(SHARED_LIB):	LDFLAGS_SHARED += $(LDFLAGS_IMPLIB)
3ae283
3ae283
$(STATIC_LIB):	$(STATIC_OBJS)
3ae283
3ae283
$(APP):		$(PACKAGE_APP)
3ae283
3ae283
$(DEFAULT_APP):	$(STATIC_OBJS) $(APP_OBJS)
3ae283
		rm -f app.tag
3ae283
		$(CC) -o $@ $^ $(LDFLAGS_APP)
3ae283
3ae283
$(SHARED_APP):	$(DSO_REF_SOLINK) $(APP_OBJS) $(SHARED_SOLINK)
3ae283
		rm -f app.tag
3ae283
		$(CC) -o $@ $(APP_OBJS) $(LDFLAGS_APP) -l$(PACKAGE)
3ae283
3ae283
$(STATIC_APP):	$(STATIC_OBJS) $(APP_OBJS)
3ae283
		rm -f app.tag
3ae283
		$(CC) -static -o $@ $^ $(LDFLAGS_STATIC)
3ae283
3ae283
3ae283
dirs: 		dirs.tag
3ae283
3ae283
dirs.tag:
3ae283
		mkdir -p build
3ae283
		mkdir -p bin
3ae283
		mkdir -p lib
3ae283
		touch dirs.tag
3ae283
3ae283
host.tag:	Makefile
3ae283
		$(CC) $(CFLAGS) -dumpmachine > host.tmp
3ae283
		mv host.tmp host.tag
3ae283
3ae283
version.tag:	$(GIT_REFERENCE_INDEX) dirs.tag
3ae283
		$(PROJECT_DIR)/sofort/tools/version.sh	\
3ae283
			-s $(SOURCE_DIR)		\
3ae283
			-o build/$(PACKAGE)_version.h	\
3ae283
			-p $(PACKAGE)
3ae283
		touch version.tag
3ae283
3ae283
distclean:	clean
e6f982
		rm -f ccenv/host.mk
e6f982
		rm -f ccenv/native.mk
3ae283
		rm -f cfgdefs.mk
3ae283
		rm -f usrdefs.mk
f88d74
		rm -f config.log
3ae283
		rm -f Makefile
d3091e
		rmdir build ccenv bin lib 2>&1 || true
3ae283
3ae283
clean:		clean-implib
3ae283
		rm -f tree.tag
3ae283
		rm -f dirs.tag
3ae283
		rm -f host.tag
3ae283
		rm -f host.tmp
3ae283
		rm -f version.tag
3ae283
		rm -f app.tag
3ae283
		rm -f $(SHARED_OBJS)
3ae283
		rm -f $(STATIC_OBJS)
3ae283
		rm -f $(APP_OBJS)
3ae283
		rm -f $(SHARED_LIB)
3ae283
		rm -f $(SHARED_SONAME)
3ae283
		rm -f $(SHARED_SOLINK)
3ae283
		rm -f $(STATIC_LIB)
3ae283
		rm -f $(APP)
3ae283
		rm -f $(DEFAULT_APP)
3ae283
		rm -f $(SHARED_APP)
3ae283
		rm -f $(STATIC_APP)
3ae283
		rm -f build/$(PACKAGE)_version.h
3ae283
		rm -f build/$(PACKAGE).pc
3ae283
3ae283
3ae283
.PHONY:		package-app \
3ae283
		all install shared static app \
3ae283
		shared-objs shared-lib \
3ae283
		shared-soname shared-solink \
3ae283
		package-shared-soname package-shared-solink \
3ae283
		static-objs static-lib \
3ae283
		default-app shared-app static-app \
3ae283
		install-shared install-static \
3ae283
		install-soname install-solink \
3ae283
		package-install-soname package-install-solink \
3ae283
		install-headers install-app \
3ae283
		install-headers-default install-headers-custom \
3ae283
		clean distclean clean-implib version \
3ae283
		.display .conf \
3ae283
		.display-project .display-env .display-tools .display-flags \
215a2c
		.display-pe .display-dirs .display-build \
3ae283
		implib implib-ver implib-soname implib-solink \
3ae283
		install-implib install-implib-ver \
3ae283
		install-implib-soname install-implib-solink