Blame Makefile.in

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