Blame Makefile.in

d40d13
PACKAGE 		?= @package@
d40d13
PROJECT_DIR 		?= @project_dir@
d40d13
d40d13
BUILD 			?= @build@
d40d13
HOST 			?= @host@
d40d13
TARGET 			?= @target@
d40d13
ARCH 			?= @arch@
d40d13
TOOLCHAIN 		?= @toolchain@
d40d13
SYSROOT 		?= @sysroot@
d40d13
CROSS_COMPILE 		?= @cross_compile@
d40d13
SHELL 			?= @shell@
d40d13
d40d13
CFLAGS_DEBUG 		?= @cflags_debug@
d40d13
CFLAGS_COMMON 		?= @cflags_common@
d40d13
CFLAGS_CMDLINE 		?= @cflags_cmdline@
d40d13
CFLAGS_CONFIG 		?= @cflags_config@
d40d13
CFLAGS_SYSROOT 		?= @cflags_sysroot@
d40d13
CFLAGS_PATH 		?= @cflags_path@
d40d13
d40d13
LDFLAGS_DEBUG 		?= @ldflags_debug@
d40d13
LDFLAGS_COMMON 		?= @ldflags_common@
d40d13
LDFLAGS_CMDLINE 	?= @ldflags_cmdline@
d40d13
LDFLAGS_CONFIG 		?= @ldflags_config@
d40d13
LDFLAGS_SYSROOT 	?= @ldflags_sysroot@
d40d13
LDFLAGS_PATH 		?= @ldflags_path@
d40d13
d40d13
PE_SUBSYSTEM 		?= @pe_subsystem@
d40d13
PE_IMAGE_BASE 		?= @pe_image_base@
d40d13
PE_CONFIG_DEFS  	?= @pe_config_defs@
d40d13
d40d13
ELF_EH_FRAME 		?= @elf_eh_frame@
d40d13
ELF_HASH_STYLE 		?= @elf_hash_style@
d40d13
ELF_CONFIG_DEFS 	?= @elf_config_defs@
d40d13
d40d13
PREFIX 			?= @prefix@
d40d13
BIN_DIR 		?= @bindir@
d40d13
LIB_DIR 		?= @libdir@
d40d13
INCLUDE_DIR 		?= @includedir@
d40d13
SYSLIB_DIR 		?= @syslibdir@
d40d13
MAN_DIR 		?= @mandir@
d40d13
DOC_DIR 		?= @docdir@
d40d13
LIBEXEC_DIR 		?= @libexecdir@
d40d13
d40d13
BUILD_CC 		?= @build_cc@
d40d13
BUILD_OS 		?= @build_os@
d40d13
BUILD_OS_BITS 		?= @build_os_bits@
d40d13
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
d40d13
src/%.lo: 	$(PROJECT_DIR)/src/%.c $(ALL_HEADERS)
d40d13
		$(CC) -c -o $@ $< $(CFLAGS_SHARED)
d40d13
d40d13
src/%.o: 	$(PROJECT_DIR)/src/%.c $(ALL_HEADERS)
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
d40d13
distclean:	clean
d40d13
		rm -f Makefile
d40d13
d40d13
clean:
d40d13
		rm -f tree.tag
d40d13
		rm -f dirs.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