Blame Makefile.in

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