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@
11ab44
BIN_DIR 		= @bindir@
11ab44
LIB_DIR 		= @libdir@
11ab44
INCLUDE_DIR 		= @includedir@
11ab44
SYSLIB_DIR 		= @syslibdir@
11ab44
MAN_DIR 		= @mandir@
11ab44
DOC_DIR 		= @docdir@
11ab44
LIBEXEC_DIR 		= @libexecdir@
11ab44
11ab44
BUILD_CC 		= @build_cc@
11ab44
BUILD_OS 		= @build_os@
11ab44
BUILD_OS_BITS 		= @build_os_bits@
11ab44
BUILD_OS_UNDERSCORE	= @build_os_underscore@
d40d13
d40d13
d40d13
d40d13
all:
d40d13
install:
d40d13
shared:
d40d13
static:
d40d13
d40d13
d40d13
d40d13
include $(PROJECT_DIR)/sysinfo/toolchain/$(TOOLCHAIN).mk
d40d13
include $(PROJECT_DIR)/sysinfo/host/$(HOST).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
d40d13
$(APP_SRCS:%.c=%.o): CFLAGS_STATIC = $(CFLAGS_APP)
d40d13
bd5bd5
src/%.lo: 	$(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag
d40d13
		$(CC) -c -o $@ $< $(CFLAGS_SHARED)
d40d13
bd5bd5
src/%.o: 	$(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag
d40d13
		$(CC) -c -o $@ $< $(CFLAGS_STATIC)
d40d13
d40d13
$(LIB_DIR)/%$(OS_LIB_SUFFIX):
d40d13
		$(CC) -shared -o $@ $^ $(LDFLAGS_SHARED)
d40d13
d40d13
$(LIB_DIR)/%$(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
d40d13
		mkdir -p $(DESTDIR)/./$(PREFIX)/./$(INCLUDE_DIR)/$(PACKAGE)
d40d13
		cp $(API_HEADERS) $(DESTDIR)/./$(PREFIX)/./$(INCLUDE_DIR)/$(PACKAGE)
d40d13
d40d13
install-shared:	shared install-implib
d40d13
		mkdir -p $(DESTDIR)/./$(PREFIX)/./$(LIB_DIR)
d40d13
		cp $(SHARED_LIB) $(DESTDIR)/./$(PREFIX)/./$(LIB_DIR)
d40d13
d40d13
install-static:	static
d40d13
		mkdir -p $(DESTDIR)/./$(PREFIX)/./$(LIB_DIR)
d40d13
		cp $(STATIC_LIB) $(DESTDIR)/./$(PREFIX)/./$(LIB_DIR)
d40d13
d40d13
install-app:	app
d40d13
		mkdir -p $(DESTDIR)/./$(PREFIX)/./$(BIN_DIR)
d40d13
		cp $(APP) $(DESTDIR)/./$(PREFIX)/./$(BIN_DIR)
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
d40d13
default-app:	static $(DEFAULT_APP) $(APP)
d40d13
d40d13
shared-app:	shared $(SHARED_APP)
d40d13
d40d13
static-app:	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)
d40d13
		$(CC) -o $@ $(APP_OBJS) -l$(PACKAGE) $(LDFLAGS_APP)
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:
d40d13
		mkdir -p $(BIN_DIR)
d40d13
		mkdir -p $(LIB_DIR)
d40d13
		touch dirs.tag
d40d13
bd5bd5
host.tag:	Makefile
bd5bd5
		$(SHELL) $(PROJECT_DIR)/sysinfo/host/host.sh --compiler="$(CC)" --cflags="$(CFLAGS)"
bd5bd5
		touch host.tag
bd5bd5
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
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)
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)
bf7b91
		@echo BIN_DIR:'                '$(BIN_DIR)
bf7b91
		@echo LIB_DIR:'                '$(LIB_DIR)
bf7b91
		@echo INCLUDE_DIR:'            '$(INCLUDE_DIR)
bf7b91
		@echo SYSLIB_DIR:'             '$(SYSLIB_DIR)
bf7b91
		@echo MAN_DIR:'                '$(MAN_DIR)
bf7b91
		@echo DOC_DIR:'                '$(DOC_DIR)
bf7b91
		@echo LIBEXEC_DIR:'            '$(LIBEXEC_DIR)
bf7b91
		@echo
bf7b91
bf7b91
.display-build:
bf7b91
		@echo BUILD_CC:'               '$(BUILD_CC)
bf7b91
		@echo BUILD_OS:'               '$(BUILD_OS)
bf7b91
		@echo BUILD_OS_BITS:'          '$(BUILD_OS_BITS)
bf7b91
		@echo BUILD_OS_USCORE:'        '$(BUILD_OS_UNDERSCORE)
bf7b91
		@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 \
bf7b91
		clean distclean \
bf7b91
		.display-env .display-tools .display-flags \
bf7b91
		.display-pe .display-elf .display-dirs .display-build