Blame Makefile.in

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