Blame Makefile.in

383aa6
PACKAGE 		= @package@
383aa6
PROJECT_DIR 		= @project_dir@
383aa6
383aa6
BUILD 			= @build@
383aa6
HOST 			= @host@
383aa6
TARGET 			= @target@
383aa6
ARCH 			= @arch@
5fea2d
COMPILER 		= @compiler@
82672b
TOOLCHAIN		= @toolchain@
383aa6
SYSROOT 		= @sysroot@
383aa6
CROSS_COMPILE 		= @cross_compile@
383aa6
SHELL 			= @shell@
383aa6
383aa6
CFLAGS_DEBUG 		= @cflags_debug@
383aa6
CFLAGS_COMMON 		= @cflags_common@
383aa6
CFLAGS_CMDLINE 		= @cflags_cmdline@
383aa6
CFLAGS_CONFIG 		= @cflags_config@
383aa6
CFLAGS_SYSROOT 		= @cflags_sysroot@
98c8e7
CFLAGS_OS		= @cflags_os@
98c8e7
CFLAGS_SITE		= @cflags_site@
383aa6
CFLAGS_PATH 		= @cflags_path@
383aa6
383aa6
LDFLAGS_DEBUG 		= @ldflags_debug@
383aa6
LDFLAGS_COMMON 		= @ldflags_common@
383aa6
LDFLAGS_CMDLINE 	= @ldflags_cmdline@
383aa6
LDFLAGS_CONFIG 		= @ldflags_config@
383aa6
LDFLAGS_SYSROOT 	= @ldflags_sysroot@
383aa6
LDFLAGS_PATH 		= @ldflags_path@
383aa6
383aa6
PE_SUBSYSTEM 		= @pe_subsystem@
383aa6
PE_IMAGE_BASE 		= @pe_image_base@
383aa6
PE_CONFIG_DEFS  	= @pe_config_defs@
383aa6
383aa6
ELF_EH_FRAME 		= @elf_eh_frame@
383aa6
ELF_HASH_STYLE 		= @elf_hash_style@
383aa6
ELF_CONFIG_DEFS 	= @elf_config_defs@
383aa6
383aa6
PREFIX 			= @prefix@
383aa6
BINDIR 			= @bindir@
383aa6
LIBDIR 			= @libdir@
383aa6
INCLUDEDIR 		= @includedir@
383aa6
SYSLIBDIR 		= @syslibdir@
383aa6
MANDIR 			= @mandir@
383aa6
DOCDIR 			= @docdir@
383aa6
LIBEXECDIR 		= @libexecdir@
383aa6
383aa6
NATIVE_CC 		= @native_cc@
383aa6
NATIVE_OS 		= @native_os@
383aa6
NATIVE_OS_BITS 		= @native_os_bits@
383aa6
NATIVE_OS_UNDERSCORE	= @native_os_underscore@
383aa6
383aa6
USER_CC                 = @user_cc@
383aa6
USER_CPP                = @user_cpp@
383aa6
USER_CXX                = @user_cxx@
383aa6
383aa6
383aa6
all:
383aa6
install:
383aa6
shared:
383aa6
static:
383aa6
383aa6
383aa6
383aa6
include $(PROJECT_DIR)/sysinfo/host/$(HOST).mk
5fea2d
include $(PROJECT_DIR)/sysinfo/compiler/$(COMPILER).mk
82672b
include $(PROJECT_DIR)/sysinfo/toolchain/$(TOOLCHAIN).mk
383aa6
383aa6
include $(PROJECT_DIR)/project/defs.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
383aa6
$(APP_SRCS:%.c=%.o): version.tag
383aa6
$(APP_SRCS:%.c=%.o): CFLAGS_STATIC = $(CFLAGS_APP)
383aa6
383aa6
src/%.lo: 	$(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag tree.tag
383aa6
		$(CC) -c -o $@ $< $(CFLAGS_SHARED)
383aa6
383aa6
src/%.o: 	$(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag tree.tag
383aa6
		$(CC) -c -o $@ $< $(CFLAGS_STATIC)
383aa6
383aa6
$(LIBDIR)/%$(OS_LIB_SUFFIX):
383aa6
		$(CC) -shared -o $@ $^ $(LDFLAGS_SHARED)
383aa6
383aa6
$(LIBDIR)/%$(OS_ARCHIVE_EXT):
383aa6
		rm -f $@
268173
		$(AR) rcs $@ $^
383aa6
383aa6
383aa6
383aa6
all:		shared static app
383aa6
383aa6
install:	install-libs install-headers install-app
383aa6
383aa6
app:		default-app
383aa6
383aa6
383aa6
install-libs:	install-shared install-static install-implib
383aa6
383aa6
install-headers:shared static
383aa6
		mkdir -p $(DESTDIR)///./$(PREFIX)/./$(INCLUDEDIR)/$(PACKAGE)
383aa6
		cp $(API_HEADERS) $(DESTDIR)///./$(PREFIX)/./$(INCLUDEDIR)/$(PACKAGE)
383aa6
383aa6
install-shared:	shared install-implib
383aa6
		mkdir -p $(DESTDIR)///./$(PREFIX)/./$(LIBDIR)
383aa6
		cp $(SHARED_LIB) $(DESTDIR)///./$(PREFIX)/./$(LIBDIR)
383aa6
383aa6
install-static:	static
383aa6
		mkdir -p $(DESTDIR)///./$(PREFIX)/./$(LIBDIR)
383aa6
		cp $(STATIC_LIB) $(DESTDIR)///./$(PREFIX)/./$(LIBDIR)
383aa6
383aa6
install-app:	app
383aa6
		mkdir -p $(DESTDIR)///./$(PREFIX)/./$(BINDIR)
383aa6
		cp $(APP) $(DESTDIR)///./$(PREFIX)/./$(BINDIR)
383aa6
383aa6
383aa6
383aa6
shared:		shared-lib shared-implib
383aa6
383aa6
static:		static-lib
383aa6
383aa6
shared-lib:	shared-objs $(SHARED_LIB)
383aa6
383aa6
static-lib:	static-objs $(STATIC_LIB)
383aa6
383aa6
shared-implib:	shared-lib
383aa6
383aa6
383aa6
383aa6
default-app:	version.tag static $(DEFAULT_APP) $(APP)
383aa6
383aa6
shared-app:	version.tag shared $(SHARED_APP)
383aa6
383aa6
static-app:	version.tag static $(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)
383aa6
383aa6
$(STATIC_LIB):	$(STATIC_OBJS)
383aa6
383aa6
$(APP):		$(DEFAULT_APP)
383aa6
		cp $^ $@
383aa6
383aa6
$(DEFAULT_APP):	$(STATIC_OBJS) $(APP_OBJS)
383aa6
		$(CC) -o $@ $^ $(LDFLAGS_APP)
383aa6
383aa6
$(SHARED_APP):	$(SHARED_LIB) $(APP_OBJS)
383aa6
		$(CC) -o $@ $(APP_OBJS) -l$(PACKAGE) $(LDFLAGS_SHARED)
383aa6
383aa6
$(STATIC_APP):	$(STATIC_OBJS) $(APP_OBJS)
383aa6
		$(CC) -static -o $@ $^ -l$(PACKAGE) $(LDFLAGS_STATIC)
383aa6
383aa6
383aa6
dirs: 		dirs.tag tree.tag
383aa6
383aa6
dirs.tag:
383aa6
		mkdir -p $(BINDIR)
383aa6
		mkdir -p $(LIBDIR)
383aa6
		touch dirs.tag
383aa6
383aa6
host.tag:	Makefile
383aa6
		$(PROJECT_DIR)/sysinfo/host/host.sh --compiler="$(CC)" --cflags="$(CFLAGS)"
383aa6
		touch host.tag
383aa6
383aa6
version.tag:
383aa6
		$(PROJECT_DIR)/sysinfo/version.sh	\
383aa6
			-s $(PROJECT_DIR)		\
383aa6
			-o build/$(PACKAGE)_version.h	\
383aa6
			-p $(PACKAGE)
383aa6
		touch version.tag
383aa6
383aa6
distclean:	clean
383aa6
		rm -f Makefile
383aa6
383aa6
clean:
383aa6
		rm -f tree.tag
383aa6
		rm -f dirs.tag
383aa6
		rm -f host.tag
383aa6
		rm -f version.tag
383aa6
		rm -f $(SHARED_OBJS)
383aa6
		rm -f $(STATIC_OBJS)
383aa6
		rm -f $(APP_OBJS)
383aa6
		rm -f $(SHARED_LIB)
383aa6
		rm -f $(STATIC_LIB)
383aa6
		rm -f $(SHARED_IMPLIB)
383aa6
		rm -f $(APP)
383aa6
		rm -f $(DEFAULT_APP)
383aa6
		rm -f $(SHARED_APP)
383aa6
		rm -f $(STATIC_APP)
383aa6
383aa6
0a8a03
.display:	.display-project .display-env .display-tools .display-flags \
383aa6
		.display-pe .display-elf .display-dirs .display-build
383aa6
0a8a03
.display-project:
0a8a03
		@echo PROJECT_DIR:'            '$(PROJECT_DIR)
0a8a03
		@echo BUILD_DIR:'              '$(CURDIR)
0a8a03
		@echo
0a8a03
383aa6
.display-env:
383aa6
		@echo BUILD:'                  '$(BUILD)
383aa6
		@echo HOST:'                   '$(HOST)
383aa6
		@echo TARGET:'                 '$(TARGET)
383aa6
		@echo ARCH:'                   '$(ARCH)
5fea2d
		@echo COMPILER:'               '$(COMPILER)
82672b
		@echo TOOLCHAIN:'              '$(TOOLCHAIN)
383aa6
		@echo SYSROOT:'                '$(SYSROOT)
14a0c0
		@echo CROSS_COMPILE:'          '$(CROSS_COMPILE)
383aa6
		@echo SHELL:'                  '$(SHELL)
383aa6
		@echo
383aa6
383aa6
.display-tools:
383aa6
		@echo CC:'                     '$(CC)
383aa6
		@echo CPP:'                    '$(CPP)
383aa6
		@echo CXX:'                    '$(CXX)
383aa6
		@echo
383aa6
		@echo AS:'                     '$(AS)
383aa6
		@echo AR:'                     '$(AR)
383aa6
		@echo LD:'                     '$(LD)
383aa6
		@echo NM:'                     '$(NM)
383aa6
		@echo OBJDUMP:'                '$(OBJDUMP)
383aa6
		@echo RANLIB:'                 '$(RANLIB)
383aa6
		@echo SIZE:'                   '$(SIZE)
383aa6
		@echo STRIP:'                  '$(STRIP)
383aa6
		@echo STRINGS:'                '$(STRINGS)
383aa6
		@echo
383aa6
		@echo ADDR2LINE:'              '$(ADDR2LINE)
383aa6
		@echo COV:'                    '$(COV)
383aa6
		@echo CXXFILT'                 '$(CXXFILT)
383aa6
		@echo ELFEDIT:'                '$(ELFEDIT)
383aa6
		@echo OBJCOPY:'                '$(OBJCOPY)
383aa6
		@echo READELF:'                '$(READELF)
383aa6
		@echo
383aa6
383aa6
.display-flags:
383aa6
		@echo CFLAGS_DEBUG:'           '$(CFLAGS_DEBUG)
383aa6
		@echo CFLAGS_COMMON:'          '$(CFLAGS_COMMON)
383aa6
		@echo CFLAGS_CMDLINE:'         '$(CFLAGS_CMDLINE)
383aa6
		@echo CFLAGS_CONFIG:'          '$(CFLAGS_CONFIG)
383aa6
		@echo CFLAGS_SYSROOT:'         '$(CFLAGS_SYSROOT)
98c8e7
		@echo CFLAGS_OS:'              '$(CFLAGS_OS)
98c8e7
		@echo CFLAGS_SITE:'            '$(CFLAGS_SITE)
383aa6
		@echo CFLAGS_PATH:'            '$(CFLAGS_PATH)
383aa6
		@echo
383aa6
		@echo LDFLAGS_DEBUG:'           '$(LDFLAGS_DEBUG)
383aa6
		@echo LDFLAGS_COMMON:'          '$(LDFLAGS_COMMON)
383aa6
		@echo LDFLAGS_CMDLINE:'         '$(LDFLAGS_CMDLINE)
383aa6
		@echo LDFLAGS_CONFIG:'          '$(LDFLAGS_CONFIG)
383aa6
		@echo LDFLAGS_SYSROOT:'         '$(LDFLAGS_SYSROOT)
383aa6
		@echo LDFLAGS_PATH:'            '$(LDFLAGS_PATH)
383aa6
		@echo
383aa6
383aa6
.display-pe:
383aa6
		@echo PE_SUBSYSTEM:'           '$(PE_SUBSYSTEM)
383aa6
		@echo PE_IMAGE_BASE:'          '$(PE_IMAGE_BASE)
383aa6
		@echo PE_CONFIG_DEFS:'         '$(PE_CONFIG_DEFS)
383aa6
		@echo
383aa6
383aa6
.display-elf:
383aa6
		@echo ELF_EH_FRAME:'           '$(ELF_EH_FRAME)
383aa6
		@echo ELF_HASH_STYLE:'         '$(ELF_HASH_STYLE)
383aa6
		@echo ELF_CONFIG_DEFS:'        '$(ELF_CONFIG_DEFS)
383aa6
		@echo
383aa6
383aa6
.display-dirs:
383aa6
		@echo PREFIX:'                 '$(PREFIX)
383aa6
		@echo BINDIR:'                 '$(BINDIR)
383aa6
		@echo LIBDIR:'                 '$(LIBDIR)
383aa6
		@echo INCLUDEDIR:'             '$(INCLUDEDIR)
383aa6
		@echo SYSLIBDIR:'              '$(SYSLIBDIR)
383aa6
		@echo MANDIR:'                 '$(MANDIR)
383aa6
		@echo DOCDIR:'                 '$(DOCDIR)
383aa6
		@echo LIBEXECDIR:'             '$(LIBEXECDIR)
383aa6
		@echo
383aa6
383aa6
.display-build:
383aa6
		@echo NATIVE_CC:'              '$(NATIVE_CC)
383aa6
		@echo NATIVE_OS:'              '$(NATIVE_OS)
383aa6
		@echo NATIVE_OS_BITS:'         '$(NATIVE_OS_BITS)
383aa6
		@echo NATIVE_OS_UNDERSCORE:'   '$(NATIVE_OS_UNDERSCORE)
383aa6
		@echo
383aa6
		@echo USER_CC:'                '$(USER_CC)
383aa6
		@echo USER_CPP:'               '$(USER_CPP)
383aa6
		@echo USER_CXX:'               '$(USER_CXX)
383aa6
		@echo
383aa6
383aa6
383aa6
.PHONY:		all install shared static app .display \
383aa6
		shared-objs shared-lib shared-implib \
383aa6
		static-objs static-lib \
383aa6
		default-app shared-app static-app \
383aa6
		install-shared install-static install-implib \
383aa6
		install-headers install-app \
383aa6
		clean distclean version \
0a8a03
		.display-project .display-env .display-tools .display-flags \
383aa6
		.display-pe .display-elf .display-dirs .display-build