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
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
d40d13
.display:
d40d13
		@echo CC:         $(CC)
d40d13
		@echo CPP:        $(CPP)
d40d13
		@echo CXX:        $(CXX)
d40d13
d40d13
		@echo AS:         $(AS)
d40d13
		@echo AR:         $(AR)
d40d13
		@echo LD:         $(LD)
d40d13
		@echo NM:         $(NM)
d40d13
		@echo OBJDUMP:    $(OBJDUMP)
d40d13
		@echo RANLIB:     $(RANLIB)
d40d13
		@echo SIZE:       $(SIZE)
d40d13
		@echo STRIP:      $(STRIP)
d40d13
		@echo STRINGS:    $(STRINGS)
d40d13
d40d13
		@echo ADDR2LINE:  $(ADDR2LINE)
d40d13
		@echo COV:        $(COV)
d40d13
		@echo CXXFILT     $(CXXFILT)
d40d13
		@echo ELFEDIT:    $(ELFEDIT)
d40d13
		@echo OBJCOPY:    $(OBJCOPY)
d40d13
		@echo READELF:    $(READELF)
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 \
d40d13
		clean distclean