Blame Makefile.in

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