Blame Makefile.in

11ab44
PACKAGE 		= @package@
11ab44
PROJECT_DIR 		= @project_dir@
11ab44
11ab44
BUILD 			= @build@
11ab44
HOST 			= @host@
11ab44
TARGET 			= @target@
11ab44
ARCH 			= @arch@
11ab44
TOOLCHAIN 		= @toolchain@
11ab44
SYSROOT 		= @sysroot@
11ab44
CROSS_COMPILE 		= @cross_compile@
11ab44
SHELL 			= @shell@
11ab44
11ab44
CFLAGS_DEBUG 		= @cflags_debug@
11ab44
CFLAGS_COMMON 		= @cflags_common@
11ab44
CFLAGS_CMDLINE 		= @cflags_cmdline@
11ab44
CFLAGS_CONFIG 		= @cflags_config@
11ab44
CFLAGS_SYSROOT 		= @cflags_sysroot@
11ab44
CFLAGS_PATH 		= @cflags_path@
11ab44
11ab44
LDFLAGS_DEBUG 		= @ldflags_debug@
11ab44
LDFLAGS_COMMON 		= @ldflags_common@
11ab44
LDFLAGS_CMDLINE 	= @ldflags_cmdline@
11ab44
LDFLAGS_CONFIG 		= @ldflags_config@
11ab44
LDFLAGS_SYSROOT 	= @ldflags_sysroot@
11ab44
LDFLAGS_PATH 		= @ldflags_path@
11ab44
11ab44
PE_SUBSYSTEM 		= @pe_subsystem@
11ab44
PE_IMAGE_BASE 		= @pe_image_base@
11ab44
PE_CONFIG_DEFS  	= @pe_config_defs@
11ab44
11ab44
ELF_EH_FRAME 		= @elf_eh_frame@
11ab44
ELF_HASH_STYLE 		= @elf_hash_style@
11ab44
ELF_CONFIG_DEFS 	= @elf_config_defs@
11ab44
11ab44
PREFIX 			= @prefix@
b023b2
BINDIR 			= @bindir@
b023b2
LIBDIR 			= @libdir@
b023b2
INCLUDEDIR 		= @includedir@
b023b2
SYSLIBDIR 		= @syslibdir@
b023b2
MANDIR 			= @mandir@
b023b2
DOCDIR 			= @docdir@
b023b2
LIBEXECDIR 		= @libexecdir@
11ab44
1857dc
NATIVE_CC 		= @native_cc@
1857dc
NATIVE_OS 		= @native_os@
1857dc
NATIVE_OS_BITS 		= @native_os_bits@
1857dc
NATIVE_OS_UNDERSCORE	= @native_os_underscore@
d40d13
7f572b
USER_CC                 = @user_cc@
7f572b
USER_CPP                = @user_cpp@
7f572b
USER_CXX                = @user_cxx@
d40d13
d40d13
d40d13
all:
d40d13
install:
d40d13
shared:
d40d13
static:
d40d13
d40d13
d40d13
d40d13
include $(PROJECT_DIR)/sysinfo/host/$(HOST).mk
05c9b5
include $(PROJECT_DIR)/sysinfo/toolchain/$(TOOLCHAIN).mk
d40d13
d40d13
include $(PROJECT_DIR)/project/defs.mk
d40d13
include $(PROJECT_DIR)/project/tree.mk
d40d13
include $(PROJECT_DIR)/project/depends.mk
d40d13
include $(PROJECT_DIR)/project/headers.mk
d40d13
include $(PROJECT_DIR)/project/common.mk
d40d13
include $(PROJECT_DIR)/project/arch.mk
d40d13
include $(PROJECT_DIR)/project/extras.mk
d40d13
include $(PROJECT_DIR)/project/overrides.mk
d40d13
d40d13
d40d13
8fd98a
$(APP_SRCS:%.c=%.o): version.tag
d40d13
$(APP_SRCS:%.c=%.o): CFLAGS_STATIC = $(CFLAGS_APP)
d40d13
4304d4
src/%.lo: 	$(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag tree.tag
d40d13
		$(CC) -c -o $@ $< $(CFLAGS_SHARED)
d40d13
4304d4
src/%.o: 	$(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag tree.tag
d40d13
		$(CC) -c -o $@ $< $(CFLAGS_STATIC)
d40d13
b023b2
$(LIBDIR)/%$(OS_LIB_SUFFIX):
d40d13
		$(CC) -shared -o $@ $^ $(LDFLAGS_SHARED)
d40d13
b023b2
$(LIBDIR)/%$(OS_ARCHIVE_EXT):
d40d13
		rm -f $@
d40d13
		$(AR) -rcs $@ $^
d40d13
d40d13
d40d13
d40d13
all:		shared static app
d40d13
d40d13
install:	install-libs install-headers install-app
d40d13
d40d13
app:		default-app
d40d13
d40d13
d40d13
install-libs:	install-shared install-static install-implib
d40d13
d40d13
install-headers:shared static
33dc49
		mkdir -p $(DESTDIR)///./$(PREFIX)/./$(INCLUDEDIR)/$(PACKAGE)
33dc49
		cp $(API_HEADERS) $(DESTDIR)///./$(PREFIX)/./$(INCLUDEDIR)/$(PACKAGE)
d40d13
d40d13
install-shared:	shared install-implib
33dc49
		mkdir -p $(DESTDIR)///./$(PREFIX)/./$(LIBDIR)
33dc49
		cp $(SHARED_LIB) $(DESTDIR)///./$(PREFIX)/./$(LIBDIR)
d40d13
d40d13
install-static:	static
33dc49
		mkdir -p $(DESTDIR)///./$(PREFIX)/./$(LIBDIR)
33dc49
		cp $(STATIC_LIB) $(DESTDIR)///./$(PREFIX)/./$(LIBDIR)
d40d13
d40d13
install-app:	app
33dc49
		mkdir -p $(DESTDIR)///./$(PREFIX)/./$(BINDIR)
33dc49
		cp $(APP) $(DESTDIR)///./$(PREFIX)/./$(BINDIR)
d40d13
d40d13
d40d13
d40d13
shared:		shared-lib shared-implib
d40d13
d40d13
static:		static-lib
d40d13
d40d13
shared-lib:	shared-objs $(SHARED_LIB)
d40d13
d40d13
static-lib:	static-objs $(STATIC_LIB)
d40d13
c34c66
shared-implib:	shared-lib
c34c66
d40d13
d40d13
4ab720
default-app:	version.tag static $(DEFAULT_APP) $(APP)
d40d13
4ab720
shared-app:	version.tag shared $(SHARED_APP)
d40d13
4ab720
static-app:	version.tag static $(STATIC_APP)
d40d13
d40d13
d40d13
d40d13
shared-objs:	dirs $(SHARED_OBJS)
d40d13
d40d13
static-objs:	dirs $(STATIC_OBJS)
d40d13
d40d13
app-objs:	dirs $(APP_OBJS)
d40d13
d40d13
d40d13
d40d13
$(SHARED_LIB):	$(SHARED_OBJS)
d40d13
d40d13
$(STATIC_LIB):	$(STATIC_OBJS)
d40d13
d40d13
$(APP):		$(DEFAULT_APP)
d40d13
		cp $^ $@
d40d13
d40d13
$(DEFAULT_APP):	$(STATIC_OBJS) $(APP_OBJS)
d40d13
		$(CC) -o $@ $^ $(LDFLAGS_APP)
d40d13
d40d13
$(SHARED_APP):	$(SHARED_LIB) $(APP_OBJS)
f9baff
		$(CC) -o $@ $(APP_OBJS) -l$(PACKAGE) $(LDFLAGS_SHARED)
d40d13
d40d13
$(STATIC_APP):	$(STATIC_OBJS) $(APP_OBJS)
d40d13
		$(CC) -static -o $@ $^ -l$(PACKAGE) $(LDFLAGS_STATIC)
d40d13
d40d13
d40d13
dirs: 		dirs.tag tree.tag
d40d13
d40d13
dirs.tag:
b023b2
		mkdir -p $(BINDIR)
b023b2
		mkdir -p $(LIBDIR)
d40d13
		touch dirs.tag
d40d13
bd5bd5
host.tag:	Makefile
26e820
		$(PROJECT_DIR)/sysinfo/host/host.sh --compiler="$(CC)" --cflags="$(CFLAGS)"
bd5bd5
		touch host.tag
bd5bd5
4ab720
version.tag:
4ab720
		$(PROJECT_DIR)/sysinfo/version.sh	\
4ab720
			-s $(PROJECT_DIR)		\
4ab720
			-o build/$(PACKAGE)_version.h	\
4ab720
			-p $(PACKAGE)
4ab720
		touch version.tag
4ab720
d40d13
distclean:	clean
d40d13
		rm -f Makefile
d40d13
d40d13
clean:
d40d13
		rm -f tree.tag
d40d13
		rm -f dirs.tag
bd5bd5
		rm -f host.tag
4ab720
		rm -f version.tag
d40d13
		rm -f $(SHARED_OBJS)
d40d13
		rm -f $(STATIC_OBJS)
d40d13
		rm -f $(APP_OBJS)
d40d13
		rm -f $(SHARED_LIB)
d40d13
		rm -f $(STATIC_LIB)
d40d13
		rm -f $(SHARED_IMPLIB)
d40d13
		rm -f $(APP)
d40d13
		rm -f $(DEFAULT_APP)
d40d13
		rm -f $(SHARED_APP)
d40d13
		rm -f $(STATIC_APP)
d40d13
d40d13
bf7b91
.display:	.display-env .display-tools .display-flags \
bf7b91
		.display-pe .display-elf .display-dirs .display-build
bf7b91
bf7b91
.display-env:
bf7b91
		@echo BUILD:'                  '$(BUILD)
bf7b91
		@echo HOST:'                   '$(HOST)
bf7b91
		@echo TARGET:'                 '$(TARGET)
bf7b91
		@echo ARCH:'                   '$(ARCH)
bf7b91
		@echo TOOLCHAIN:'              '$(TOOLCHAIN)
bf7b91
		@echo SYSROOT:'                '$(SYSROOT)
bf7b91
		@echo XCOMPILE:'               '$(CROSS_COMPILE)
bf7b91
		@echo SHELL:'                  '$(SHELL)
886e64
		@echo
bf7b91
bf7b91
.display-tools:
bf7b91
		@echo CC:'                     '$(CC)
bf7b91
		@echo CPP:'                    '$(CPP)
bf7b91
		@echo CXX:'                    '$(CXX)
bf7b91
		@echo
bf7b91
		@echo AS:'                     '$(AS)
bf7b91
		@echo AR:'                     '$(AR)
bf7b91
		@echo LD:'                     '$(LD)
bf7b91
		@echo NM:'                     '$(NM)
bf7b91
		@echo OBJDUMP:'                '$(OBJDUMP)
bf7b91
		@echo RANLIB:'                 '$(RANLIB)
bf7b91
		@echo SIZE:'                   '$(SIZE)
bf7b91
		@echo STRIP:'                  '$(STRIP)
bf7b91
		@echo STRINGS:'                '$(STRINGS)
bf7b91
		@echo
bf7b91
		@echo ADDR2LINE:'              '$(ADDR2LINE)
bf7b91
		@echo COV:'                    '$(COV)
bf7b91
		@echo CXXFILT'                 '$(CXXFILT)
bf7b91
		@echo ELFEDIT:'                '$(ELFEDIT)
bf7b91
		@echo OBJCOPY:'                '$(OBJCOPY)
bf7b91
		@echo READELF:'                '$(READELF)
bf7b91
		@echo
bf7b91
bf7b91
.display-flags:
bf7b91
		@echo CFLAGS_DEBUG:'           '$(CFLAGS_DEBUG)
bf7b91
		@echo CFLAGS_COMMON:'          '$(CFLAGS_COMMON)
bf7b91
		@echo CFLAGS_CMDLINE:'         '$(CFLAGS_CMDLINE)
bf7b91
		@echo CFLAGS_CONFIG:'          '$(CFLAGS_CONFIG)
bf7b91
		@echo CFLAGS_SYSROOT:'         '$(CFLAGS_SYSROOT)
bf7b91
		@echo CFLAGS_PATH:'            '$(CFLAGS_PATH)
bf7b91
		@echo
bf7b91
		@echo LDFLAGS_DEBUG:'           '$(LDFLAGS_DEBUG)
bf7b91
		@echo LDFLAGS_COMMON:'          '$(LDFLAGS_COMMON)
bf7b91
		@echo LDFLAGS_CMDLINE:'         '$(LDFLAGS_CMDLINE)
bf7b91
		@echo LDFLAGS_CONFIG:'          '$(LDFLAGS_CONFIG)
bf7b91
		@echo LDFLAGS_SYSROOT:'         '$(LDFLAGS_SYSROOT)
bf7b91
		@echo LDFLAGS_PATH:'            '$(LDFLAGS_PATH)
bf7b91
		@echo
bf7b91
bf7b91
.display-pe:
bf7b91
		@echo PE_SUBSYSTEM:'           '$(PE_SUBSYSTEM)
bf7b91
		@echo PE_IMAGE_BASE:'          '$(PE_IMAGE_BASE)
bf7b91
		@echo PE_CONFIG_DEFS:'         '$(PE_CONFIG_DEFS)
bf7b91
		@echo
bf7b91
bf7b91
.display-elf:
bf7b91
		@echo ELF_EH_FRAME:'           '$(ELF_EH_FRAME)
bf7b91
		@echo ELF_HASH_STYLE:'         '$(ELF_HASH_STYLE)
bf7b91
		@echo ELF_CONFIG_DEFS:'        '$(ELF_CONFIG_DEFS)
bf7b91
		@echo
bf7b91
bf7b91
.display-dirs:
bf7b91
		@echo PREFIX:'                 '$(PREFIX)
b023b2
		@echo BINDIR:'                 '$(BINDIR)
b023b2
		@echo LIBDIR:'                 '$(LIBDIR)
b023b2
		@echo INCLUDEDIR:'             '$(INCLUDEDIR)
b023b2
		@echo SYSLIBDIR:'              '$(SYSLIBDIR)
b023b2
		@echo MANDIR:'                 '$(MANDIR)
b023b2
		@echo DOCDIR:'                 '$(DOCDIR)
b023b2
		@echo LIBEXECDIR:'             '$(LIBEXECDIR)
bf7b91
		@echo
bf7b91
bf7b91
.display-build:
1857dc
		@echo NATIVE_CC:'              '$(NATIVE_CC)
1857dc
		@echo NATIVE_OS:'              '$(NATIVE_OS)
1857dc
		@echo NATIVE_OS_BITS:'         '$(NATIVE_OS_BITS)
3d3888
		@echo NATIVE_OS_UNDERSCORE:'   '$(NATIVE_OS_UNDERSCORE)
bf7b91
		@echo
7f572b
		@echo USER_CC:'                '$(USER_CC)
7f572b
		@echo USER_CPP:'               '$(USER_CPP)
7f572b
		@echo USER_CXX:'               '$(USER_CXX)
7f572b
		@echo
d40d13
d40d13
d40d13
.PHONY:		all install shared static app .display \
d40d13
		shared-objs shared-lib shared-implib \
d40d13
		static-objs static-lib \
d40d13
		default-app shared-app static-app \
d40d13
		install-shared install-static install-implib \
d40d13
		install-headers install-app \
4ab720
		clean distclean version \
bf7b91
		.display-env .display-tools .display-flags \
bf7b91
		.display-pe .display-elf .display-dirs .display-build