mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
make, scripts: Re-add files necessary for building ytools
Re-add everthing needed for building and packaging ytools. This is a big commit, 2002 lines of code. It mostly consists of C/C++ machinery, plus some documentation-related stuff. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
0a9340af49
commit
bf16c6714b
27 changed files with 1975 additions and 0 deletions
16
make/backup.mk
Normal file
16
make/backup.mk
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
BACKUP_SOURCE ?= .
|
||||||
|
BACKUP_TARGET ?= ..
|
||||||
|
BACKUP_DATE ?= $(shell date +'%y%m%d-%H%M%S')
|
||||||
|
|
||||||
|
_BACKUP_SOURCE = $(notdir $(shell cd $(BACKUP_SOURCE); $(PWD)))
|
||||||
|
|
||||||
|
ifndef BACKUP_MK_INCLUDED
|
||||||
|
BACKUP_MK_INCLUDED = true
|
||||||
|
|
||||||
|
backup: distclean
|
||||||
|
tar -C .. $(_BACKUP_SOURCE) -cjf $(BACKUP_TARGET)/$(_BACKUP_SOURCE)-$(BACKUP_DATE).tar.bz2
|
||||||
|
|
||||||
|
purge-last-backup:
|
||||||
|
$(RM) -f $(shell ls $(BACKUP_TARGET)/$(_BACKUP_SOURCE)-*.tar.bz2 | tail -1)
|
||||||
|
|
||||||
|
endif # ifndef BACKUP_MK_INCLUDED
|
||||||
23
make/conf.mk
Normal file
23
make/conf.mk
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
include $(JWBDIR)/make/defs.mk
|
||||||
|
include $(JWBDIR)/make/rules.mk
|
||||||
|
include $(JWBDIR)/make/dev-utils.mk
|
||||||
|
|
||||||
|
all:
|
||||||
|
clean: clean.conf
|
||||||
|
install: install_CFG install_files_SYSCFG install_files_LOGROT install_files_CRONTAB install_files_RSYSLOG \
|
||||||
|
install_files_APACHE_CONF install_files_SYSTEMD install_files_INIT install_files_TMPFILES $(CONF_D)
|
||||||
|
test:
|
||||||
|
|
||||||
|
clean.conf:
|
||||||
|
$(RM) -rf *~ .*.swp *.done
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_SUBDIR),)
|
||||||
|
$(INSTALLED_CFG): $(INSTALL_CFGDIR)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(CONF_D),)
|
||||||
|
INSTALLED_CONF_D = $(addprefix $(INSTALL_CFGDIR)/,$(CONF_D))
|
||||||
|
$(INSTALL_CFGDIR)/$(CONF_D):
|
||||||
|
$(INSTALL) -d -m $(CFGDIRMODE) -o $(CFGDIROWNER) -g $(CFGDIRGROUP) $@
|
||||||
|
install: $(INSTALLED_CONF_D)
|
||||||
|
endif
|
||||||
8
make/cpp-extra-targets.mk
Normal file
8
make/cpp-extra-targets.mk
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
ifndef CPP_EXTRA_TARGETS_MK_INCLUDED
|
||||||
|
CPP_EXTRA_TARGETS_MK_INCLUDED = true
|
||||||
|
|
||||||
|
all:
|
||||||
|
expand-macros:
|
||||||
|
make 2>/dev/null | sed '/$(CC)\|$(CXX)/ !d; s/$(CC)\|$(CXX)//; s/-o .*//' | grep -v "Wl\|rdynamic" | xargs $(CXX) -E -C | indent
|
||||||
|
|
||||||
|
endif # ifndef CPP_EXTRA_TARGETS_MK_INCLUDED
|
||||||
83
make/debugger.mk
Normal file
83
make/debugger.mk
Normal file
|
|
@ -0,0 +1,83 @@
|
||||||
|
CORE_IGNORE := $(wildcard *.intern-state*)
|
||||||
|
CORE_VG ?= $(firstword $(filter-out $(CORE_IGNORE),$(wildcard vgcore vgcore.*)))
|
||||||
|
CORE_REGULAR ?= $(firstword $(filter-out $(CORE_IGNORE),$(wildcard core core.*)))
|
||||||
|
CORE ?= $(firstword $(CORE_VG) $(CORE_REGULAR))
|
||||||
|
|
||||||
|
ifneq ($(CORE),)
|
||||||
|
ifneq ($(CORE),$(CORE_VG)) # trick doesn't work on valgrind cores
|
||||||
|
CORE_DUMPER = $(shell echo -e "quit" | $(DEBUGGER) --core=$(CORE) 2>&1 | \
|
||||||
|
$(SED) '/Core was generated/ !d; s/Core was generated by `//; s/ .*//; s/\x27\.$$//')
|
||||||
|
else
|
||||||
|
CORE_DUMPER = $(EXE_PATH)
|
||||||
|
endif
|
||||||
|
else ifeq ($(CORE_DUMPER),)
|
||||||
|
CORE_DUMPER = $(EXE_PATH)
|
||||||
|
endif
|
||||||
|
|
||||||
|
PID = $(shell pidof $(EXE_PATH))
|
||||||
|
|
||||||
|
all:
|
||||||
|
distclean: distclean.debugger
|
||||||
|
|
||||||
|
distclean.debugger:
|
||||||
|
rm -f .gdb_history
|
||||||
|
|
||||||
|
gdb ddd:
|
||||||
|
ifneq ($(CORE),)
|
||||||
|
$@ --core=$(CORE) --args $(CORE_DUMPER) $(EXE_ARGS)
|
||||||
|
else
|
||||||
|
$@ --args $(CORE_DUMPER) $(EXE_ARGS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
lldb:
|
||||||
|
ifneq ($(CORE),)
|
||||||
|
$@ --core $(CORE) -f $(CORE_DUMPER) -- $(EXE_ARGS)
|
||||||
|
else
|
||||||
|
$@ -f $(CORE_DUMPER) -- $(EXE_ARGS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
kdbg:
|
||||||
|
$@ $(CORE_DUMPER) $(CORE) -a "$(EXE_ARGS)"
|
||||||
|
|
||||||
|
cgdb:
|
||||||
|
ifneq ($(CORE),)
|
||||||
|
$@ -- --core=$(CORE) --args $(CORE_DUMPER) $(EXE_ARGS)
|
||||||
|
else
|
||||||
|
$@ -- --args $(CORE_DUMPER) $(EXE_ARGS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
attach:
|
||||||
|
$(DEBUGGER) $(EXE_PATH) -p $(PID)
|
||||||
|
|
||||||
|
attach-lldb:
|
||||||
|
lldb $(EXE_PATH) -p $(PID)
|
||||||
|
|
||||||
|
attach-gdb:
|
||||||
|
gdb $(EXE_PATH) -p $(PID)
|
||||||
|
|
||||||
|
attach-ddd:
|
||||||
|
ddd $(EXE_PATH) -p $(PID)
|
||||||
|
|
||||||
|
attach-strace:
|
||||||
|
strace -f $(EXE_PATH) -p $(PID)
|
||||||
|
|
||||||
|
report:
|
||||||
|
generate-coredump-report.sh -l
|
||||||
|
mkdir -p crashes
|
||||||
|
if ls *core*.txt.bz2* >/dev/null 2>&1; then mv *core*.txt.bz2 crashes/; fi
|
||||||
|
|
||||||
|
view-report:
|
||||||
|
less `ls -rt crashes/*core*.txt.bz2 | tail -1`
|
||||||
|
localcore:
|
||||||
|
echo core.%h.%e.%p | sudo tee /proc/sys/kernel/core_pattern
|
||||||
|
cp `ls -rt /var/cores/*core* 2>/dev/null | tail -1` .
|
||||||
|
|
||||||
|
centralcore:
|
||||||
|
echo /var/cores/core.%h.%e.%p | sudo tee /proc/sys/kernel/core_pattern
|
||||||
|
|
||||||
|
coreclean: centralcore-clean
|
||||||
|
|
||||||
|
centralcore-clean:
|
||||||
|
$(RM) -f /var/cores/core* /var/cores/vgcore* || exit 0
|
||||||
|
echo-pid:
|
||||||
|
@echo PID = $(PID)
|
||||||
808
make/defs-cpp.mk
Normal file
808
make/defs-cpp.mk
Normal file
|
|
@ -0,0 +1,808 @@
|
||||||
|
ifndef JW_BUILD_CPP_DEFS_MK_INCLUDED
|
||||||
|
JW_BUILD_CPP_DEFS_MK_INCLUDED := true
|
||||||
|
|
||||||
|
# performance optimization for clean targets
|
||||||
|
ifeq ($(filter clean distclean,$(MAKECMDGOALS)),)
|
||||||
|
|
||||||
|
# -- default choices
|
||||||
|
|
||||||
|
#COMPILER_SUITE ?= clang
|
||||||
|
COMPILER_SUITE ?= gcc
|
||||||
|
CPP_STANDARD_VERSION ?= 17
|
||||||
|
C_STANDARD_VERSION ?= 11
|
||||||
|
USE_PROJECT_LIB ?= true
|
||||||
|
EXPORT_PROJECT_LIB ?= $(USE_PROJECT_LIB)
|
||||||
|
USE_JW_BUILD ?= true
|
||||||
|
USE_EXCEPTIONS_IN_C ?= true
|
||||||
|
USE_COMPILER_OPTIMIZATION_OPTS ?= false
|
||||||
|
USE_COMPILER_DEBUG_OPTS ?= true
|
||||||
|
USE_VERSION_MACROS ?= true
|
||||||
|
COMPILE_DEBUG_CODE ?= true
|
||||||
|
|
||||||
|
ifeq ($(findstring $(TARGET_OS),linux),)
|
||||||
|
USE_SYSTEMD := false
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_CCACHE),true)
|
||||||
|
CCACHE := ccache$(space)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# -- build TAGGED_TMPL_TAGS cascade
|
||||||
|
|
||||||
|
TAGGED_TMPL_MAKEFILES = $(wildcard $(addsuffix .mk,$(foreach t,$(TAGGED_TMPL_DIRS),$(addprefix $(t)/,$(TAGGED_TMPL_TAGS)))))
|
||||||
|
|
||||||
|
# TODO: maybe push this whome MCU-specific stuff somewhere else
|
||||||
|
ifneq ($(findstring st-nucleo-f103rb,$(TAGGED_TMPL_TAGS)),)
|
||||||
|
TAGGED_TMPL_TAGS += cortex-m3
|
||||||
|
MCU_BOARD_MODEL ?= ST-NUCLEO-F103RB
|
||||||
|
FINAL_CPPFLAGS += -DST_NUCLEO_F103RB
|
||||||
|
MCU_FLASH_OFFSET ?= 0x0000000
|
||||||
|
MCU_FLASH_SIZE ?= 0x5000
|
||||||
|
MCU_MEM_FETCH_OFFSET ?= 0x08000000
|
||||||
|
MCU_MEM_FETCH_SIZE ?= $(MCU_FLASH_SIZE)
|
||||||
|
#MCU_OPENOCD_CFG_NAME ?= openocd-$(MCU_BOARD_LC).cfg
|
||||||
|
ifneq ($(findstring j-link,$(TAGGED_TMPL_TAGS)),)
|
||||||
|
MCU_OPENOCD_CFG_NAME ?= openocd-st-nucleo-f103rb-jlink.cfg
|
||||||
|
else
|
||||||
|
MCU_OPENOCD_CFG_NAME ?= openocd-st-nucleo-f103rb.cfg
|
||||||
|
endif
|
||||||
|
MODM_BSPS += modm:nucleo-f103rb
|
||||||
|
MCU_FLASH_BANK_NAME ?= internal
|
||||||
|
ifneq ($(MCU_FLASH_BANK_NAME),internal)
|
||||||
|
$(error Unsupported flash bank name "$(MCU_FLASH_BANK_NAME)")
|
||||||
|
endif
|
||||||
|
else ifneq ($(findstring st-disc1-f429i,$(TAGGED_TMPL_TAGS)),)
|
||||||
|
TAGGED_TMPL_TAGS += cortex-m4
|
||||||
|
MCU_BOARD_MODEL ?= ST-DISC1-F429I
|
||||||
|
FINAL_CPPFLAGS += -DST_DISC1_F429I
|
||||||
|
#MCU_OPENOCD_CFG_NAME ?= openocd-st-stm32f429disc1.cfg
|
||||||
|
MCU_OPENOCD_CFG_NAME ?= openocd-st-stm32f429discovery.cfg
|
||||||
|
MCU_FLASH_BANK_NAME ?= internal
|
||||||
|
ifeq ($(MCU_FLASH_BANK_NAME),internal)
|
||||||
|
MCU_FLASH_OFFSET ?= 0x00000000
|
||||||
|
MCU_FLASH_SIZE ?= 0x00200000
|
||||||
|
MCU_MEM_FETCH_OFFSET ?= 0x08000000
|
||||||
|
MCU_MEM_FETCH_SIZE ?= $(MCU_FLASH_SIZE)
|
||||||
|
else ifeq ($(MCU_FLASH_BANK_NAME),otp)
|
||||||
|
MCU_FLASH_OFFSET ?= 0x00000000
|
||||||
|
MCU_FLASH_SIZE ?= 0x00000200
|
||||||
|
MCU_MEM_FETCH_OFFSET ?= 0x1fff7800
|
||||||
|
MCU_MEM_FETCH_SIZE ?= $(MCU_FLASH_SIZE)
|
||||||
|
else
|
||||||
|
$(error Unsupported flash bank name "$(MCU_FLASH_BANK_NAME)")
|
||||||
|
endif
|
||||||
|
ifeq ($(MCU_OPENOCD_CFG_NAME),openocd-st-stm32f429disc1.cfg)
|
||||||
|
ifeq ($(MCU_FLASH_BANK_NAME),internal)
|
||||||
|
MCU_FLASH_BANK ?= 1
|
||||||
|
endif
|
||||||
|
else ifeq ($(MCU_OPENOCD_CFG_NAME),openocd-st-stm32f429discovery.cfg)
|
||||||
|
ifeq ($(MCU_FLASH_BANK_NAME),internal)
|
||||||
|
MCU_FLASH_BANK ?= 1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# modm:disco-f769ni (SIC), not disco-f769i. mbed does the same, despite the
|
||||||
|
# fact that a board of this name doesn't exist.
|
||||||
|
MODM_BSPS += modm:disco-f429zi
|
||||||
|
else ifneq ($(findstring st-disco-f769i,$(TAGGED_TMPL_TAGS)),)
|
||||||
|
TAGGED_TMPL_TAGS += cortex-m7
|
||||||
|
MCU_BOARD_MODEL ?= ST-DISCO-F769I
|
||||||
|
FINAL_CPPFLAGS += -DST_DISCO_F769I
|
||||||
|
ifneq ($(findstring j-link,$(TAGGED_TMPL_TAGS)),)
|
||||||
|
MCU_OPENOCD_CFG_NAME ?= openocd-stmqspi-st-stm32f769i-disco-jlink.cfg
|
||||||
|
else
|
||||||
|
MCU_OPENOCD_CFG_NAME ?= openocd-stmqspi-st-stm32f769i-disco.cfg
|
||||||
|
endif
|
||||||
|
MCU_FLASH_BANK_NAME ?= external
|
||||||
|
ifeq ($(MCU_FLASH_BANK_NAME),external)
|
||||||
|
MCU_FLASH_OFFSET ?= 0x00000000
|
||||||
|
MCU_FLASH_SIZE ?= 0x04000000
|
||||||
|
MCU_MEM_FETCH_OFFSET ?= 0x90000000
|
||||||
|
MCU_MEM_FETCH_SIZE ?= $(MCU_FLASH_SIZE)
|
||||||
|
else ifeq ($(MCU_FLASH_BANK_NAME),internal)
|
||||||
|
MCU_FLASH_OFFSET ?= 0x00000000
|
||||||
|
MCU_FLASH_SIZE ?= 0x00200000
|
||||||
|
MCU_MEM_FETCH_OFFSET ?= 0x08000000
|
||||||
|
MCU_MEM_FETCH_SIZE ?= $(MCU_FLASH_SIZE)
|
||||||
|
else
|
||||||
|
$(error Unsupported flash bank name "$(MCU_FLASH_BANK_NAME)")
|
||||||
|
endif
|
||||||
|
ifeq ($(MCU_OPENOCD_CFG_NAME),openocd-stmqspi-st-stm32f769i-disco.cfg)
|
||||||
|
ifeq ($(MCU_FLASH_BANK_NAME),external)
|
||||||
|
MCU_FLASH_BANK ?= 1
|
||||||
|
else ifeq ($(MCU_FLASH_BANK_NAME),internal)
|
||||||
|
MCU_FLASH_BANK ?= 0
|
||||||
|
endif
|
||||||
|
else ifeq ($(MCU_OPENOCD_CFG_NAME),openocd-st-stm32f7discovery.cfg)
|
||||||
|
ifeq ($(MCU_FLASH_BANK_NAME),external)
|
||||||
|
MCU_FLASH_BANK ?= 2
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# modm:disco-f769ni (SIC), not disco-f769i. mbed does the same, despite the
|
||||||
|
# fact that a board of this name doesn't exist.
|
||||||
|
MODM_BSPS += modm:disco-f769ni
|
||||||
|
else
|
||||||
|
MCU_OPENOCD_CFG_NAME ?= openocd-$(MCU_BOARD_LC).cfg
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(findstring cortex-m,$(TAGGED_TMPL_TAGS)),)
|
||||||
|
TAGGED_TMPL_TAGS += cortex-m
|
||||||
|
ifneq ($(findstring cortex-m3,$(TAGGED_TMPL_TAGS)),)
|
||||||
|
TARGET_CPU = cortex-m3
|
||||||
|
else ifneq ($(findstring cortex-m4,$(TAGGED_TMPL_TAGS)),)
|
||||||
|
TARGET_CPU = cortex-m4
|
||||||
|
else ifneq ($(findstring cortex-m7,$(TAGGED_TMPL_TAGS)),)
|
||||||
|
TARGET_CPU = cortex-m7
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(findstring cortex,$(TAGGED_TMPL_TAGS)),)
|
||||||
|
TAGGED_TMPL_TAGS += cortex
|
||||||
|
endif
|
||||||
|
|
||||||
|
# ----- tool chain
|
||||||
|
|
||||||
|
ifneq ($(TARGET_TRIPLET),$(HOST_TRIPLET)) # we're cross-compiling
|
||||||
|
|
||||||
|
TC_BIN_PREFIX ?= $(TARGET_TRIPLET)-
|
||||||
|
TC_SYS_ROOT ?= /usr/$(TARGET_TRIPLET)
|
||||||
|
|
||||||
|
ifeq ($(TARGET),mingw)
|
||||||
|
|
||||||
|
ifneq ($(wildcard $(TC_BIN_PREFIX)gcc),)
|
||||||
|
CROSS_TOOL_DIR ?=
|
||||||
|
TC_SYS_ROOT ?= /usr/$(TARGET_TRIPLET)/sys-root/mingw
|
||||||
|
else
|
||||||
|
CROSS_TOOL_DIR ?= /opt/cross-tools
|
||||||
|
TC_BIN_PREFIX ?= $(CROSS_TOOL_DIR)/bin/i686-pc-mingw32-
|
||||||
|
endif
|
||||||
|
|
||||||
|
FINAL_CPPFLAGS += -D_WINDOWS
|
||||||
|
FINAL_LDFLAGS += -lws2_32
|
||||||
|
WINDRES ?= $(TC_BIN_PREFIX)windres
|
||||||
|
USE_GFILTER ?= false
|
||||||
|
MS_LD ?= wine $(HOME)/local/mingw/packages/msvcpp/bin/LIB.EXE
|
||||||
|
endif
|
||||||
|
|
||||||
|
#FINAL_CPPFLAGS += -I$(TC_SYS_ROOT)/include
|
||||||
|
#FINAL_LDFLAGS += -L$(TC_SYS_ROOT)/lib
|
||||||
|
|
||||||
|
else # we're not cross-compiling
|
||||||
|
|
||||||
|
TC_SYS_ROOT ?= /usr
|
||||||
|
FINAL_LIBFLAGS += -pthread
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(COMPILER_SUITE),gcc)
|
||||||
|
|
||||||
|
GCC ?= $(CCACHE)$(TC_BIN_PREFIX)gcc
|
||||||
|
GXX ?= $(CCACHE)$(TC_BIN_PREFIX)g++
|
||||||
|
GNU_LD ?= $(TC_BIN_PREFIX)ld
|
||||||
|
CLANG ?= $(CCACHE)$(TC_BIN_PREFIX)clang
|
||||||
|
CLANGPP ?= $(CCACHE)$(TC_BIN_PREFIX)clang++
|
||||||
|
STRIP ?= $(TC_BIN_PREFIX)strip
|
||||||
|
RANLIB ?= $(TC_BIN_PREFIX)ranlib
|
||||||
|
AR ?= $(TC_BIN_PREFIX)ar
|
||||||
|
PKG_CONFIG_EXE ?= $(TC_BIN_PREFIX)pkg-config
|
||||||
|
CPP_FILT ?= $(TC_BIN_PREFIX)c++filt
|
||||||
|
OBJCOPY ?= $(TC_BIN_PREFIX)objcopy
|
||||||
|
OBJDUMP ?= $(TC_BIN_PREFIX)objdump
|
||||||
|
|
||||||
|
# compiler and linker
|
||||||
|
# gcc
|
||||||
|
GCC_VERSION := $(shell $(GCC) -v 2>&1 | $(SED) '/gcc.version/I !d; s/.*version *//I; s/ \+.*//')
|
||||||
|
GCC_VERSION_NUMBERS := $(subst ., ,$(GCC_VERSION))
|
||||||
|
GCC_MAJOR := $(word 1,$(GCC_VERSION_NUMBERS))
|
||||||
|
GCC_MINOR := $(word 2,$(GCC_VERSION_NUMBERS))
|
||||||
|
GCC_REV := $(word 3,$(GCC_VERSION_NUMBERS))
|
||||||
|
|
||||||
|
# Not needed anywhere
|
||||||
|
#GNU_LD_VERSION := $(shell $(LD) -V | $(SED) '/GNU ld/ !d; s/(.*)//; s/[^0-9.-]*//')
|
||||||
|
#GNU_LD_VERSION_NUMBERS := $(subst ., ,$(GNU_LD_VERSION))
|
||||||
|
#GNU_LD_MAJOR := $(word 1,$(GNU_LD_VERSION_NUMBERS))
|
||||||
|
#GNU_LD_MINOR := $(word 2,$(GNU_LD_VERSION_NUMBERS))
|
||||||
|
#GNU_LD_REV := $(word 3,$(GNU_LD_VERSION_NUMBERS))
|
||||||
|
|
||||||
|
CC = $(GCC)
|
||||||
|
CXX = $(GXX)
|
||||||
|
LD = $(GXX)
|
||||||
|
|
||||||
|
FINAL_CXXFLAGS += -std=c++$(CPP_STANDARD_VERSION)
|
||||||
|
FINAL_CFLAGS += -std=gnu$(C_STANDARD_VERSION)
|
||||||
|
|
||||||
|
ifeq ($(shell $(TEST) $(GCC_MAJOR) -ge 5; $(ECHO) $$?),0)
|
||||||
|
ifeq ($(USE_CPP_FORCE_OVERRIDE),true)
|
||||||
|
GCC_CXXFLAGS += -Werror=suggest-override
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(GCC_MAJOR),2)
|
||||||
|
FINAL_LPPFLAGS += -lm
|
||||||
|
FINAL_CPPFLAGS += -I/usr/local/include
|
||||||
|
else ifeq ($(GCC_MAJOR),3)
|
||||||
|
ifeq ($(GCC_MINOR),3)
|
||||||
|
FINAL_LPPFLAGS += -lgcc_s
|
||||||
|
# FINAL_LPPFLAGS += -L/usr/local/gcc3.3/lib
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
FINAL_CPPFLAGS += -DGCC_HASCLASSVISIBILITY
|
||||||
|
endif
|
||||||
|
|
||||||
|
else ifeq ($(COMPILER_SUITE),clang)
|
||||||
|
|
||||||
|
# clang
|
||||||
|
CLANG_CXXFLAGS += -Wno-unused-private-field -Wno-self-assign-field -Wno-overloaded-virtual
|
||||||
|
CC = $(CLANG)
|
||||||
|
CXX = $(CLANGPP)
|
||||||
|
LD = $(CLANGPP)
|
||||||
|
|
||||||
|
ifeq ($(USE_CPP_WARN_INCONSISTENT_OVERRIDE),true)
|
||||||
|
CLANG_CXXFLAGS += -Winconsistent-missing-override
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif # COMPILER_SUITE
|
||||||
|
|
||||||
|
# -- jw-build variables based on arch and toolchain
|
||||||
|
|
||||||
|
ifeq ($(TARGET_TRIPLET),arm-none-eabi)
|
||||||
|
LIBTYPE ?= static
|
||||||
|
else
|
||||||
|
LIBTYPE ?= shared
|
||||||
|
endif
|
||||||
|
|
||||||
|
INTEL_ARCHS := i386 i486 i586 i686 x86_64
|
||||||
|
|
||||||
|
ifneq ($(findstring $(TARGET_ARCH),$(INTEL_ARCHS)),)
|
||||||
|
TAGGED_TMPL_TAGS += x86
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(COMPILER_SUITE),gcc)
|
||||||
|
DEBUGGER ?= gdb
|
||||||
|
FINAL_EXTRA_DEBUG_FLAGS += -ggdb
|
||||||
|
else ifeq ($(COMPILER_SUITE),clang)
|
||||||
|
DEBUGGER = lldb
|
||||||
|
endif
|
||||||
|
|
||||||
|
# -- gather compiler options in BUILD_XXXFLAGS
|
||||||
|
|
||||||
|
FINAL_CFLAGS += $(CFLAGS)
|
||||||
|
FINAL_CXXFLAGS += $(CXXFLAGS)
|
||||||
|
FINAL_CPPFLAGS += $(CPPFLAGS)
|
||||||
|
FINAL_LDFLAGS += $(LDFLAGS)
|
||||||
|
|
||||||
|
FINAL_CPPFLAGS += -D_FILE_OFFSET_BITS=64 -Wall -Wno-unused-value -Wno-deprecated -DPROJECT_STR=\"$(PROJECT)\"
|
||||||
|
FINAL_LDFLAGS += -Wall
|
||||||
|
|
||||||
|
ifeq ($(TARGET_ARCH),$(ARCH_32))
|
||||||
|
FINAL_CPPFLAGS += -m32
|
||||||
|
FINAL_LDFLAGS += -m32
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(findstring $(TARGET_ARCH),$(INTEL_ARCHS)),)
|
||||||
|
FINAL_CPPFLAGS += -fPIC
|
||||||
|
ifeq ($(findstring mingw,$(TARGET_ABI)),)
|
||||||
|
ifeq ($(LIBTYPE),shared)
|
||||||
|
FINAL_LIBFLAGS += -ldl
|
||||||
|
else
|
||||||
|
FINAL_LIBFLAGS += -l:libdl.a
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(TARGET_ARCH),armv7hl)
|
||||||
|
FINAL_CPPFLAGS += -fPIC
|
||||||
|
else ifeq ($(TARGET_ARCH),aarch64)
|
||||||
|
FINAL_CPPFLAGS += -fPIC
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(DEVELOPMENT),true)
|
||||||
|
FINAL_CPPFLAGS += -D_DEVELOPMENT_
|
||||||
|
export G_SLICE = always-malloc
|
||||||
|
export G_DEBUG = gc-friendly,resident-modules
|
||||||
|
export MALLOC_CHECK_ = 2
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(LOG_QUAL_PREFIX),)
|
||||||
|
FINAL_CPPFLAGS += -DKEEP_FILES_OPEN -DLOG_QUAL_PREFIX=\"$(LOG_QUAL_PREFIX)\"
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CATCH_ONLY_YERROR),true)
|
||||||
|
FINAL_CPPFLAGS += -DCATCH_ONLY_YERROR
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_VERSION_MACROS),true)
|
||||||
|
FINAL_CPPFLAGS += -DVERSION=$(HEX_VERSION) -DVERSION_STR=\"$(VERSION)\"
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(TARGET_TRIPLET),arm-none-eabi)
|
||||||
|
|
||||||
|
ifeq ($(TARGET_CPU),cortex-m3)
|
||||||
|
FINAL_CPPFLAGS += -mcpu=cortex-m3 -mthumb
|
||||||
|
FINAL_LDFLAGS += -mcpu=cortex-m3 -mthumb
|
||||||
|
else ifeq ($(TARGET_CPU),cortex-m4)
|
||||||
|
FINAL_CPPFLAGS += -mcpu=cortex-m4 -mthumb
|
||||||
|
FINAL_LDFLAGS += -mcpu=cortex-m4 -mthumb
|
||||||
|
else ifeq ($(TARGET_CPU),cortex-m7)
|
||||||
|
FINAL_CPPFLAGS += -mcpu=cortex-m7 -mthumb
|
||||||
|
FINAL_LDFLAGS += -mcpu=cortex-m7 -mthumb
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(findstring cortex-m,$(TARGET_CPU)),)
|
||||||
|
|
||||||
|
# don't wrap error message lines
|
||||||
|
#FINAL_LDFLAGS += -fmessage-length=0
|
||||||
|
|
||||||
|
# don't know what kind of optimization that is
|
||||||
|
#FINAL_LDFLAGS += -Og
|
||||||
|
|
||||||
|
# stick with what janware code tends to expect
|
||||||
|
FINAL_LDFLAGS += -fsigned-char
|
||||||
|
|
||||||
|
# I have no clue which part would evaluate these names
|
||||||
|
FINAL_LDFLAGS += -ffunction-sections
|
||||||
|
FINAL_LDFLAGS += -fdata-sections
|
||||||
|
FINAL_LDFLAGS += -ffreestanding
|
||||||
|
FINAL_LDFLAGS += -fno-move-loop-invariants
|
||||||
|
|
||||||
|
# skip any automatic initialization
|
||||||
|
FINAL_LDFLAGS += -nostartfiles
|
||||||
|
|
||||||
|
# garbage collect unused input sections
|
||||||
|
FINAL_LDFLAGS += -Xlinker --gc-sections
|
||||||
|
#FINAL_LDFLAGS += -Xlinker --print-gc-sections
|
||||||
|
|
||||||
|
# create map file
|
||||||
|
FINAL_LDFLAGS += -Wl,-Map,"$(EXE_MAP)"
|
||||||
|
|
||||||
|
# use newlib-nano, provides symbols _write _close _fstat _isatty _lseek (at least)
|
||||||
|
# (TODO: No -Wl necessary?)
|
||||||
|
FINAL_LDFLAGS += --specs=nano.specs
|
||||||
|
FINAL_LDFLAGS += --specs=nosys.specs
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
USE_DISABLE_COMPILER_OPTIMISATION_OPTS = false
|
||||||
|
USE_EXCEPTIONS_IN_C = false
|
||||||
|
ARM_NONE_EABI_ALLFLAGS += -fno-exceptions
|
||||||
|
ifeq ($(USE_DISABLE_COMPILER_OPTIMISATION_OPTS),true)
|
||||||
|
ARM_NONE_EABI_ALLFLAGS += -Os
|
||||||
|
endif
|
||||||
|
FINAL_LDFLAGS += $(ARM_NONE_EABI_ALLFLAGS)
|
||||||
|
FINAL_CPPFLAGS += $(ARM_NONE_EABI_ALLFLAGS)
|
||||||
|
FINAL_CXXFLAGS += -fno-rtti
|
||||||
|
|
||||||
|
# -- used by modm, but currently disabled for test purposes
|
||||||
|
#FINAL_CFLAGS += -fno-threadsafe-statics
|
||||||
|
#FINAL_CFLAGS += -fno-unwind-tables
|
||||||
|
#FINAL_CFLAGS += -fstrict-enums
|
||||||
|
#FINAL_CFLAGS += -fuse-cxa-atexit
|
||||||
|
#FINAL_CFLAGS += -fshort-wchar
|
||||||
|
#FINAL_CFLAGS += -fsingle-precision-constant
|
||||||
|
#FINAL_CFLAGS += -funsigned-bitfields
|
||||||
|
#FINAL_CFLAGS += -funsigned-char
|
||||||
|
#FINAL_CFLAGS += -fwrapv
|
||||||
|
#FINAL_CFLAGS += -g3
|
||||||
|
#FINAL_CFLAGS += -gdwarf
|
||||||
|
#FINAL_CFLAGS += -W
|
||||||
|
#FINAL_CFLAGS += -Wall
|
||||||
|
#FINAL_CFLAGS += -Wdouble-promotion
|
||||||
|
#FINAL_CFLAGS += -Wduplicated-cond
|
||||||
|
#FINAL_CFLAGS += -Werror=format
|
||||||
|
#FINAL_CFLAGS += -Werror=maybe-uninitialized
|
||||||
|
#FINAL_CFLAGS += -Werror=overflow
|
||||||
|
#FINAL_CFLAGS += -Werror=sign-compare
|
||||||
|
#FINAL_CFLAGS += -Wextra
|
||||||
|
#FINAL_CFLAGS += -Wlogical-op
|
||||||
|
#FINAL_CFLAGS += -Wpointer-arith
|
||||||
|
#FINAL_CFLAGS += -Wundef
|
||||||
|
|
||||||
|
|
||||||
|
#FINAL_CXXFLAGS += -fdata-sections
|
||||||
|
#FINAL_CXXFLAGS += -ffunction-sections
|
||||||
|
#FINAL_CXXFLAGS += -finline-limit=10000
|
||||||
|
#FINAL_CPPFLAGS += -fshort-wchar
|
||||||
|
#FINAL_CPPFLAGS += -fsingle-precision-constant
|
||||||
|
#FINAL_CPPFLAGS += -funsigned-bitfields
|
||||||
|
#FINAL_CPPFLAGS += -funsigned-char
|
||||||
|
#FINAL_CPPFLAGS += -fwrapv
|
||||||
|
#FINAL_CPPFLAGS += -g3
|
||||||
|
#FINAL_CPPFLAGS += -gdwarf
|
||||||
|
#FINAL_CPPFLAGS += -W
|
||||||
|
#FINAL_CPPFLAGS += -Wall
|
||||||
|
#FINAL_CPPFLAGS += -Wdouble-promotion
|
||||||
|
#FINAL_CPPFLAGS += -Wduplicated-cond
|
||||||
|
#FINAL_CPPFLAGS += -Werror=format
|
||||||
|
#FINAL_CPPFLAGS += -Werror=maybe-uninitialized
|
||||||
|
#FINAL_CPPFLAGS += -Werror=overflow
|
||||||
|
#FINAL_CPPFLAGS += -Werror=sign-compare
|
||||||
|
#FINAL_CPPFLAGS += -Wextra
|
||||||
|
#FINAL_CPPFLAGS += -Wlogical-op
|
||||||
|
#FINAL_CXXFLAGS += -Wpointer-arith
|
||||||
|
#FINAL_CPPFLAGS += -Wundef
|
||||||
|
#FINAL_CXXFLAGS += -fno-threadsafe-statics
|
||||||
|
#FINAL_CPPFLAGS += -fno-unwind-tables
|
||||||
|
#FINAL_CXXFLAGS += -fstrict-enums
|
||||||
|
#FINAL_CPPFLAGS += -fuse-cxa-atexit
|
||||||
|
#FINAL_CXXFLAGS += -std=c++17
|
||||||
|
#FINAL_CXXFLAGS += -Woverloaded-virtual
|
||||||
|
#FINAL_CXXFLAGS += -fno-move-loop-invariants
|
||||||
|
#FINAL_CPPFLAGS += -fno-split-wide-types
|
||||||
|
#FINAL_CPPFLAGS += -fno-tree-loop-optimize
|
||||||
|
|
||||||
|
#FINAL_CPPFLAGS += -fno-exceptions
|
||||||
|
#FINAL_CXXFLAGS += -fno-rtti
|
||||||
|
|
||||||
|
ifneq ($(findstring gnu-mcu-eclipse,$(TAGGED_TMPL_TAGS)),)
|
||||||
|
LD_DEFINE_SYMBOLS += _sbrk
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
FINAL_LDFLAGS += $(addprefix -u ,$(LD_DEFINE_SYMBOLS))
|
||||||
|
|
||||||
|
# -- target files and dirs
|
||||||
|
|
||||||
|
SRC_SUFFIX += $(sort $(suffix $(wildcard $(TOPDIR)/hdr/*)))
|
||||||
|
LOCAL_SRC += Makefile $(wildcard $(addprefix *,$(SRC_SUFFIX)))
|
||||||
|
SRC_HEADERED += $(shell if [ "$(LOCAL_SRC)" ]; then grep -ic "it services" $(LOCAL_SRC) | $(SED) '/:0$$/ d; s/:.*$$//'; fi)
|
||||||
|
SRC_UNHEADERED += $(filter-out $(SRC_HEADERED),$(LOCAL_SRC))
|
||||||
|
LOCAL_C ?= $(wildcard *.c)
|
||||||
|
LOCAL_CPP ?= $(wildcard *.cc *.cpp *.C)
|
||||||
|
LOCAL_H ?= $(wildcard *.h *.H *.hpp *.hh)
|
||||||
|
SFILES ?= $(wildcard *.S *.sx)
|
||||||
|
#PREREQ_H += $(foreach dir,$(PREREQ_DIR),$(wildcard $(dir)/*.h))
|
||||||
|
ALL_H += $(LOCAL_H) $(PREREQ_H)
|
||||||
|
SRC_ALL_CPP += $(filter-out $(SRC_ALL_CPP_IGNORE),$(LOCAL_C) $(LOCAL_CPP) $(LOCAL_H))
|
||||||
|
SRC_C += $(filter %.c, $(SRC_ALL_CPP))
|
||||||
|
SRC_CPP += $(filter %.cc %.cpp %.C, $(SRC_ALL_CPP))
|
||||||
|
BUILD_OBJ += $(addprefix $(FLAVOUR_PREFIX),$(patsubst %.C,%.o,$(patsubst %.cpp,%.o,$(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(filter %.c %.cpp %.cc %.C, $(SRC_ALL_CPP)))))))
|
||||||
|
BUILD_OBJ += $(addprefix $(FLAVOUR_PREFIX),$(patsubst %.sx,%.o,$(patsubst %.S,%.o,$(SFILES))))
|
||||||
|
|
||||||
|
#PREREQ_C += $(foreach dir,$(PREREQ_DIR),$(wildcard $(dir)/*.c))
|
||||||
|
#PREREQ_CPP += $(foreach dir,$(PREREQ_DIR),$(wildcard $(dir)/*.c)) \
|
||||||
|
# $(foreach dir,$(PREREQ_DIR),$(wildcard $(dir)/*.cpp))
|
||||||
|
#PREREQ_CSRC += $(PREREQ_H) $(PREREQ_C) $(PREREQ_CPP)
|
||||||
|
REQUIRED_DIR += $(patsubst %,$(JWBDIR)/%,$(REQUIRED))
|
||||||
|
REQUIRED_DONE += $(patsubst %,%/all.done,$(REQUIRED_DIR))
|
||||||
|
REQUIRED_H += $(foreach dir,$(REQUIRED_DIR),$(wildcard $(dir)/*.h))
|
||||||
|
REQUIRED_C += $(foreach dir,$(REQUIRED_DIR),$(wildcard $(dir)/*.c))
|
||||||
|
REQUIRED_CPP += $(foreach dir,$(REQUIRED_DIR),$(wildcard $(dir)/*.cpp)) \
|
||||||
|
$(foreach dir,$(PREREQ_DIR),$(wildcard $(dir)/*.cpp))
|
||||||
|
REQUIRED_CSRC += $(REQUIRED_H) $(REQUIRED_C) $(REQUIRED_CPP)
|
||||||
|
|
||||||
|
ALL_C += $(LOCAL_C) $(PREREQ_CPP)
|
||||||
|
ALL_CPP += $(LOCAL_CPP) $(PREREQ_CPP)
|
||||||
|
ALL_CSRC += $(LOCAL_CSRC) $(PREREQ_CSRC)
|
||||||
|
|
||||||
|
ifeq ($(USE_QT),true)
|
||||||
|
include $(JWBDIR)/make/qtversion.mk
|
||||||
|
include $(JWBDIR)/make/qt-defs.mk
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_X),true)
|
||||||
|
FINAL_LDFLAGS += -L/usr/X11/$(SYSTEM_LIBDIR_NAME) -lXext -lX11
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(TARGET_TRIPLET),arm-none-eabi)
|
||||||
|
FINAL_LPPFLAGS += -lstdc++
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(TARGET),mingw)
|
||||||
|
FINAL_CPPFLAGS += -DWIN32
|
||||||
|
# see https://stackoverflow.com/questions/4492799
|
||||||
|
FINAL_LDFLAGS += -fstack-protector
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(LOG_THREAD_NAMES), true)
|
||||||
|
FINAL_CPPFLAGS += -DSLOG_THREAD_NAMES
|
||||||
|
endif
|
||||||
|
|
||||||
|
# ----- standard features, switched on with USE_XXX = true
|
||||||
|
|
||||||
|
#include $(JWBDIR)/make/lib-deps.mk
|
||||||
|
|
||||||
|
ifeq ($(USE_GFILTER),true)
|
||||||
|
GFILT = sh $(firstword $(wildcard $(JWBDIR)/contrib/gfilt/gfilt $(JWBDIR)/bin/gfilt))
|
||||||
|
ifneq ($(strip $(GFILT)),sh)
|
||||||
|
GXX = $(GFILT)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_PROJECT_LIB),true)
|
||||||
|
PROJECTLIB_LDFLAGS += -L$(TOPDIR)/lib -l$(LIBNAME)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(filter jw-build,$(PREREQ_BUILD)),)
|
||||||
|
ifeq ($(TARGET),mingw)
|
||||||
|
JW_FINAL_LDFLAGS += -lglib-2.0 -lws2_32 -lstdc++
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_SYSTEMD),true)
|
||||||
|
FINAL_CPPFLAGS += -D_USE_SYSTEMD_ $(shell $(PKG_CONFIG_EXE) --cflags libsystemd)
|
||||||
|
FINAL_LDFLAGS += $(shell $(PKG_CONFIG_EXE) --libs libsystemd)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_TIMER),true)
|
||||||
|
FINAL_CPPFLAGS += -D_USE_TIMER_
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_FAST_LOG),false)
|
||||||
|
FINAL_CPPFLAGS += -D_USE_FAST_LOG_=0
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_YAMD),true)
|
||||||
|
CC = yamd-gcc
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_MPATROL),true)
|
||||||
|
#FINAL_CPPFLAGS += -include /usr/include/mpatrol.h
|
||||||
|
FINAL_LDFLAGS += -lmpatrolmt -lbfd -liberty
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_VALGRIND),true)
|
||||||
|
FINAL_CPPFLAGS += -include /usr/include/valgrind/memcheck.h -D_VALGRIND_
|
||||||
|
# FINAL_LDFLAGS +=
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_MCHECK),true)
|
||||||
|
FINAL_LDFLAGS += -lmcheck
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_STACK_PROTECTOR),true)
|
||||||
|
FINAL_CPPFLAGS += -fstack-protector-all
|
||||||
|
#FINAL_CPPFLAGS += -fstack-protector
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_STACK_CHECKER),true)
|
||||||
|
ifeq "$(COMPILER_SUITE)" "clang"
|
||||||
|
FINAL_CPPFLAGS += -fsanitize=address -fno-omit-frame-pointer
|
||||||
|
FINAL_LDFLAGS += -fsanitize=address
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_DBMALLOC),true)
|
||||||
|
CONTRIB_LIBS += dbmalloc
|
||||||
|
FINAL_CPPFLAGS += -DDBMALLOC -DEXITFUN=_exit -I$(TOPDIR)/contrib/dbmalloc
|
||||||
|
FINAL_LDFLAGS += -ldbmalloc
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_DMALLOC),true)
|
||||||
|
FINAL_CPPFLAGS += -DDMALLOC -DDMALLOC_FUNC_CHECK -DSTORE_SEEN_COUNT
|
||||||
|
FINAL_LDFLAGS += -ldmallocthcxx -ldmallocth
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_MEMWATCH),true)
|
||||||
|
FINAL_CPPFLAGS += -DMEMWATCH -DMW_STDIO
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_EFENCE),true)
|
||||||
|
FINAL_CPPFLAGS += -DEFENCE
|
||||||
|
FINAL_LDFLAGS += -lefence
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_TRACING),true)
|
||||||
|
FINAL_CPPFLAGS += -D_DO_TRACE_
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_ASSERTIONS),false)
|
||||||
|
FINAL_CPPFLAGS += -DNDEBUG
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(COMPILE_DEBUG_CODE),true)
|
||||||
|
FINAL_CPPFLAGS += -D_DEBUG_
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(COMPILE_DEBUG_LOG),true)
|
||||||
|
FINAL_CPPFLAGS += -D_LOG_DEBUG_
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_MPATROL),true)
|
||||||
|
FINAL_CPPFLAGS += -include $(JWBDIR)/include/mpatrol.h
|
||||||
|
FINAL_LDFLAGS += -lmpatrolmt -lbfd -liberty
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BREAK_ABI),true)
|
||||||
|
FINAL_CPPFLAGS += -D_BREAK_ABI_
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_STACK_CHECK),true)
|
||||||
|
FINAL_CPPFLAGS += -fstack-check
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_COMPILER_DEBUG_OPTS),true)
|
||||||
|
#FINAL_EXTRA_DEBUG_FLAGS += -gdwarf-2
|
||||||
|
FINAL_CPPFLAGS += -g3 $(FINAL_EXTRA_DEBUG_FLAGS)
|
||||||
|
FINAL_LDFLAGS += -g3 $(FINAL_EXTRA_DEBUG_FLAGS)
|
||||||
|
ifneq ($(USE_COMPILER_OPTIMIZATION_OPTS),true)
|
||||||
|
FINAL_CPPFLAGS += -Og
|
||||||
|
FINAL_LDFLAGS += -Og
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CC),$(GCC))
|
||||||
|
GCC_NO_OPT_FLAGS = \
|
||||||
|
-fno-inline-functions-called-once \
|
||||||
|
-fno-tree-loop-optimize \
|
||||||
|
-fno-early-inlining \
|
||||||
|
-fno-default-inline
|
||||||
|
else ifeq ($(CC),$(CLANG))
|
||||||
|
FINAL_CPPFLAGS += -Werror
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_COMPILER_OPTIMIZATION_OPTS),true)
|
||||||
|
FINAL_CPPFLAGS += -funroll-loops -O3
|
||||||
|
else ifeq ($(USE_DISABLE_COMPILER_OPTIMISATION_OPTS),true)
|
||||||
|
NO_OPT_FLAGS = \
|
||||||
|
-O0 -g -fno-inline -fno-omit-frame-pointer \
|
||||||
|
-fno-optimize-sibling-calls \
|
||||||
|
$(GCC_NO_OPT_FLAGS)
|
||||||
|
# -fconserve-stack
|
||||||
|
|
||||||
|
# breaks constexpr
|
||||||
|
#NO_OPT_FLAGS += -fno-builtin
|
||||||
|
|
||||||
|
_NO_OPT_FLAGS = \
|
||||||
|
-O0 \
|
||||||
|
-fno-implicit-inline-templates \
|
||||||
|
-fno-implement-inlines \
|
||||||
|
-fno-default-inline \
|
||||||
|
-fno-inline \
|
||||||
|
-finline-limit=0 \
|
||||||
|
-fkeep-inline-functions \
|
||||||
|
-fno-inline-functions \
|
||||||
|
$(GCC_NO_OPT_FLAGS)
|
||||||
|
|
||||||
|
FINAL_CPPFLAGS += $(NO_OPT_FLAGS)
|
||||||
|
FINAL_LDFLAGS += $(NO_OPT_FLAGS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_EXCEPTIONS_IN_C),true)
|
||||||
|
FINAL_CFLAGS += -fexceptions
|
||||||
|
ifeq ($(LIBTYPE),shared)
|
||||||
|
GCC_LDFLAGS += -shared-libgcc
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(STRIP_SYMBOLS),true)
|
||||||
|
STRIP_DONE ?= strip.done
|
||||||
|
endif
|
||||||
|
|
||||||
|
FINAL_INCLUDE += $(LOCAL_INCLUDE)
|
||||||
|
|
||||||
|
# force use of double quotes, allow header namespaces
|
||||||
|
ifeq ($(HDRDIR_SCOPE_SUFFIX),)
|
||||||
|
FINAL_INCLUDE += -I.
|
||||||
|
else
|
||||||
|
FINAL_INCLUDE += -iquote .
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_PROJECT_LIB),true)
|
||||||
|
FINAL_INCLUDE += $(PROJECT_INCLUDE) -I$(TOPDIR)/include
|
||||||
|
FINAL_LIBFLAGS += -L$(BUILD_LIBDIR)
|
||||||
|
endif
|
||||||
|
|
||||||
|
FINAL_INCLUDE += $(call proj_query, cflags $(PREREQ_BUILD) $(PROJECT))
|
||||||
|
|
||||||
|
LDFLAGS_QUERY_ARGS = $(addprefix --exclude ,$(LDFLAGS_EXCLUDE))
|
||||||
|
FINAL_LIBFLAGS += $(call proj_query, ldflags $(LDFLAGS_QUERY_ARGS) --add-self $(PREREQ_BUILD))
|
||||||
|
|
||||||
|
# the following is necessary, because not all projects have build.libname = none in project.conf
|
||||||
|
ifeq ($(USE_PROJECT_LIB),true)
|
||||||
|
LDFLAGS_QUERY_ARGS_SELF = --add-self
|
||||||
|
endif
|
||||||
|
FINAL_LIBFLAGS += $(call proj_query, ldflags $(LDFLAGS_QUERY_ARGS) $(LDFLAGS_QUERY_ARGS_SELF) $(PROJECT))
|
||||||
|
|
||||||
|
ifeq ($(USE_SNDFILE),true)
|
||||||
|
FINAL_LIBFLAGS += -lsndfile
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_FFTW),true)
|
||||||
|
FINAL_LIBFLAGS += -lfftw3
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_GLIB),true)
|
||||||
|
FINAL_CPPFLAGS += $(shell $(PKG_CONFIG_EXE) --cflags glib-2.0)
|
||||||
|
FINAL_LIBFLAGS += $(shell $(PKG_CONFIG_EXE) --libs glib-2.0)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CC),$(CLANG))
|
||||||
|
COMPILER_CFLAGS += $(CLANG_CFLAGS)
|
||||||
|
COMPILER_CPPFLAGS += $(CLANG_CPPFLAGS)
|
||||||
|
COMPILER_CXXFLAGS += $(CLANG_CXXFLAGS)
|
||||||
|
COMPILER_LDFLAGS += $(CLANG_LDFLAGS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CC),$(GCC))
|
||||||
|
COMPILER_CFLAGS += $(GCC_CFLAGS)
|
||||||
|
COMPILER_CPPFLAGS += $(GCC_CPPFLAGS)
|
||||||
|
COMPILER_CXXFLAGS += $(GCC_CXXFLAGS)
|
||||||
|
COMPILER_LDFLAGS += $(GCC_LDFLAGS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
FINAL_CFLAGS += $(LOCAL_CFLAGS) $(PROJECT_CFLAGS) $(COMPLILER_CFLAGS) $(FINAL_INCLUDE)
|
||||||
|
FINAL_CPPFLAGS += $(LOCAL_CPPFLAGS) $(PROJECT_INCLUDE) $(PROJECT_CPPFLAGS) $(COMPILER_CPPFLAGS) $(FINAL_INCLUDE)
|
||||||
|
FINAL_CXXFLAGS += $(LOCAL_CXXFLAGS) $(PROJECT_CXXFLAGS) $(COMPILER_CXXFLAGS) $(FINAL_INCLUDE)
|
||||||
|
FINAL_LDFLAGS += $(LOCAL_LDFLAGS) $(PROJECTLIB_LDFLAGS) $(PROJECT_LDFLAGS) $(COMPILER_LDFLAGS) $(FINAL_LPPFLAGS) $(FINAL_LIBFLAGS)
|
||||||
|
|
||||||
|
#RPM_REQUIRES = $(shell $(ECHO) "$(RPM_REQUIRES_RUN) $(RPM_REQUIRES_DEVEL)" | $(add_flavour_prefix))
|
||||||
|
RPM_REQUIRES += $(RPM_REQUIRES_RUN) $(RPM_REQUIRES_DEVEL)
|
||||||
|
|
||||||
|
REAL_CFLAGS ?= $(FINAL_CFLAGS)
|
||||||
|
REAL_CPPFLAGS ?= $(FINAL_CPPFLAGS)
|
||||||
|
REAL_CXXFLAGS ?= $(FINAL_CXXFLAGS)
|
||||||
|
REAL_LDFLAGS ?= $(FINAL_LDFLAGS)
|
||||||
|
|
||||||
|
# -- LIB
|
||||||
|
INSTALLATION_FILE_TYPES += LIB
|
||||||
|
#BUILD_PIDIR = $(BUILD_LIBDIR)
|
||||||
|
#BUILD_PI = $(addprefix $(BUILD_PIDIR)/,$(PLUGIN))
|
||||||
|
#INSTALL_PIDIR = $(INSTALL_LIBDIR)
|
||||||
|
#INSTALLED_PI = $(addprefix $(INSTALL_PIDIR)/,$(PLUGIN))
|
||||||
|
|
||||||
|
BUILD_LIBDIR ?= $(TOPDIR)/lib
|
||||||
|
|
||||||
|
LOCAL_LIBS += $(CONTRIB_LIBS) $(PLUGIN)
|
||||||
|
ifeq ($(TARGET),mingw)
|
||||||
|
ifeq ($(TC_SYS_ROOT),)
|
||||||
|
CONTRIB_LIBS_PATH += $(CROSS_TOOL_DIR)/bin
|
||||||
|
else
|
||||||
|
CONTRIB_LIBS_PATH += $(TC_SYS_ROOT)/lib
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
INSTALL_LIBDIR ?= $(EXE_PREFIX)/lib
|
||||||
|
|
||||||
|
ifeq ($(LIBTYPE),shared)
|
||||||
|
ifneq ($(TARGET),mingw)
|
||||||
|
FINAL_LDFLAGS += -rdynamic
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
LIB_SO ?=
|
||||||
|
FINAL_LDFLAGS += -static
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_PROJECT_LIB),true)
|
||||||
|
LIBNAME ?= $(PROJECT)
|
||||||
|
MEMBERS += $(LIB_A)($(BUILD_OBJ))
|
||||||
|
VERSION_SCRIPT = $(BUILD_LIBDIR)/version.ldscript
|
||||||
|
# TODO: use something like this as unifying variable, there are far too many
|
||||||
|
# lib-related variables
|
||||||
|
LOCAL_LIBS +=
|
||||||
|
ifneq ($(TARGET),mingw)
|
||||||
|
LIB_A ?= $(BUILD_LIBDIR)/lib$(LIBNAME).a
|
||||||
|
SO_SUFFIX ?= so.$(MAJOR_MINOR_RELEASE)
|
||||||
|
SO_PREFIX ?= lib
|
||||||
|
LIB_SO ?= $(BUILD_LIBDIR)/lib$(LIBNAME).$(SO_SUFFIX)
|
||||||
|
LINKS_SO += $(filter-out $(LIB_SO),$(shell $(ECHO) $(LIB_SO) | $(SED) -e "s/\.so\..*$$/.so/"))
|
||||||
|
INSTALLED_LINKS_SO += $(filter-out $(INSTALLED_LIB_SO),$(shell $(ECHO) $(INSTALLED_LIB_SO) | $(SED) -e "s/\.so\..*$$/.so/"))
|
||||||
|
INSTALLED_LIB_A = $(INSTALL_LIBDIR)/lib$(LIBNAME).a
|
||||||
|
else
|
||||||
|
LIB_A = $(BUILD_LIBDIR)/lib$(LIBNAME)-static.a
|
||||||
|
#WINRES_RC_TMPL = $(JWBDIR)/make/winres-minimal.rc.tmpl
|
||||||
|
WINRES_RC_TMPL = $(JWBDIR)/make/winres.rc.tmpl
|
||||||
|
WINRES_RC = $(BUILD_LIBDIR)/$(PROJECT).rc
|
||||||
|
WINRES_O = $(WINRES_RC).o
|
||||||
|
SO_SUFFIX ?= dll
|
||||||
|
SO_PREFIX ?=
|
||||||
|
LIB_DEF = $(BUILD_LIBDIR)/$(LIBNAME).def
|
||||||
|
MSVCPP_IMPLIB = $(BUILD_LIBDIR)/$(LIBNAME).lib
|
||||||
|
LIB_SO ?= $(BUILD_LIBDIR)/$(LIBNAME).dll
|
||||||
|
INSTALLED_LIB_A = $(INSTALL_LIBDIR)/lib$(LIBNAME).a
|
||||||
|
endif # mingw
|
||||||
|
BUILD_LIB += $(LIB_SO)
|
||||||
|
endif # USE_PROJECT_LIB
|
||||||
|
|
||||||
|
INSTALLED_LIB_SO = $(addprefix $(INSTALL_LIBDIR)/,$(notdir $(LIB_SO)))
|
||||||
|
INSTALLED_DEF = $(addprefix $(INSTALL_LIBDIR)/,$(wildcard *.lib *.exp))
|
||||||
|
INSTALLED_LIB += $(addprefix $(INSTALL_LIBDIR)/,$(LOCAL_LIBS))
|
||||||
|
BUILD_LIB += $(addprefix $(BUILD_LIBDIR)/,$(LOCAL_LIBS))
|
||||||
|
INSTALLED_ALL_LIBS = $(addprefix $(INSTALL_LIBDIR)/,$(wildcard *.a))
|
||||||
|
INSTALLED_LIB += $(INSTALLED_LIB_SO) $(INSTALLED_SHOBJS) \
|
||||||
|
$(INSTALLED_LINKS_SO) $(sort $(INSTALLED_LIB_A) $(INSTALLED_ALL_LIBS)) \
|
||||||
|
$(INSTALLED_DEF)
|
||||||
|
|
||||||
|
endif # ifeq ($(filter clean distclean,$(MAKECMDGOALS)),)
|
||||||
|
endif # ifndef JW_BUILD_CPP_DEFS_MK_INCLUDED
|
||||||
45
make/depend.mk
Normal file
45
make/depend.mk
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
# variables
|
||||||
|
DEPEND_CFLAGS += -D__MAKEDEPEND__
|
||||||
|
DEPEND_CXXFLAGS += -D__MAKEDEPEND__
|
||||||
|
DEPEND_MK += $(addprefix .,$(addsuffix .dep.mk, $(BUILD_OBJ)))
|
||||||
|
|
||||||
|
ifeq ($(DEPEND_MK_INCLUDED),)
|
||||||
|
|
||||||
|
all:
|
||||||
|
clean: depclean
|
||||||
|
|
||||||
|
# convenience targets
|
||||||
|
dep: $(DEPEND_MK)
|
||||||
|
depclean:
|
||||||
|
$(RM) -f .*.dep.mk
|
||||||
|
|
||||||
|
$(DEPEND_MK): $(PREREQ_DONE)
|
||||||
|
|
||||||
|
ifneq ($(DEPEND_MK),)
|
||||||
|
ifeq ($(MAKECMDGOALS),)
|
||||||
|
-include $(DEPEND_MK)
|
||||||
|
endif
|
||||||
|
ifneq ($(filter all,$(MAKECMDGOALS)),)
|
||||||
|
-include $(DEPEND_MK)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
%.o: .%.o.dep.mk
|
||||||
|
|
||||||
|
.%.o.dep.mk: %.cpp $(BUILD_HDR) $(SRC_H)
|
||||||
|
$(CC) -M $(FINAL_CXXFLAGS) $(FINAL_CPPFLAGS) $(DEPEND_CXXFLAGS) $< -o $@
|
||||||
|
|
||||||
|
.%.o.dep.mk: %.cc $(BUILD_HDR) $(SRC_H)
|
||||||
|
$(CC) -M $(FINAL_CXXFLAGS) $(FINAL_CPPFLAGS) $(DEPEND_CXXFLAGS) $< -o $@
|
||||||
|
|
||||||
|
.%.o.dep.mk: %.c $(BUILD_HDR) $(SRC_H)
|
||||||
|
$(CC) -M $(FINAL_CFLAGS) $(FINAL_CPPFLAGS) $(DEPEND_CXXFLAGS) $< -o $@
|
||||||
|
|
||||||
|
show-vars: show-vars-depend-mk
|
||||||
|
show-vars-depend-mk:
|
||||||
|
@echo DEPEND_MK = $(DEPEND_MK)
|
||||||
|
@echo BUILD_HDR = $(BUILD_HDR)
|
||||||
|
@echo SRC_H = $(SRC_H)
|
||||||
|
|
||||||
|
endif # DEPEND_MK_INCLUDED
|
||||||
|
DEPEND_MK_INCLUDED := true
|
||||||
21
make/exe.mk
Normal file
21
make/exe.mk
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
# generic utility modules
|
||||||
|
# (c) 2001 jannet it services
|
||||||
|
# contact@jannet.de
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
include $(JWBDIR)/make/run.mk
|
||||||
|
include $(JWBDIR)/make/depend.mk
|
||||||
|
include $(JWBDIR)/make/dev-utils.mk
|
||||||
|
|
||||||
|
all: $(EXE) $(BUILD_EXE_BIN) $(STRIP_DONE)
|
||||||
|
install: $(INSTALLED_EXE) $(INSTALLED_EXE_BIN)
|
||||||
|
run test: all.dirs $(EXE) $(EXE_BIN)
|
||||||
|
strace: $(EXE) $(EXE_BIN)
|
||||||
|
|
||||||
|
clean: execlean localclean profclean
|
||||||
|
|
||||||
|
ifeq ($(USE_PROJECT_LIB),true)
|
||||||
|
$(LIB_SO): $(LIB_A)
|
||||||
|
$(EXE): $(LIB_SO)
|
||||||
|
endif
|
||||||
|
all.dirs:
|
||||||
70
make/htdocs.mk
Normal file
70
make/htdocs.mk
Normal file
|
|
@ -0,0 +1,70 @@
|
||||||
|
LESS_SRC ?= $(wildcard *.less)
|
||||||
|
LESS_GENERATED_CSS ?= $(patsubst %.less,%.css,$(LESS_SRC))
|
||||||
|
LESS_CPY ?= lesscpy
|
||||||
|
|
||||||
|
include $(JWBDIR)/make/defs.mk
|
||||||
|
|
||||||
|
# -- HTML
|
||||||
|
PRETTIER := $(shell $(WHICH) prettier 2>/dev/null)
|
||||||
|
INSTALLATION_FILE_TYPES += HTML
|
||||||
|
BUILD_HTMLDIR = $(TOPDIR)/htdocs
|
||||||
|
LOCAL_HTML += $(filter-out $(DONT_INSTALL),$(wildcard *.html *.css *.php *.js) $(FONTS) $(IMAGES))
|
||||||
|
DONT_LINT_HTML += $(shell $(ECHO) $(wildcard *.html) | xargs --no-run-if-empty $(GREP) -l '<?php')
|
||||||
|
LOCAL_HTML_LINT ?= $(addprefix .,$(addsuffix .lint,$(filter-out $(DONT_LINT_HTML),$(wildcard *.html *.php *.css *.js))))
|
||||||
|
HTML_STOPDIR_NAME ?= htdocs
|
||||||
|
ifeq ($(HTML_SUBDIR),)
|
||||||
|
HTML_SUBDIR := $(shell $(PWD) | $(SED) '/.*\/$(HTML_STOPDIR_NAME)\(\/\|$$\)/!d; s%.*/$(HTML_STOPDIR_NAME)\(/\|$$\)%%')
|
||||||
|
endif
|
||||||
|
ifeq ($(HTML_SUBDIR),)
|
||||||
|
INSTALL_HTMLDIR ?= $(PROJECT_HTMLDIR)
|
||||||
|
else
|
||||||
|
INSTALL_HTMLDIR ?= $(PROJECT_HTMLDIR)/$(HTML_SUBDIR)
|
||||||
|
endif
|
||||||
|
INSTALLED_HTML += $(addprefix $(INSTALL_HTMLDIR)/,$(LOCAL_HTML))
|
||||||
|
|
||||||
|
|
||||||
|
include $(JWBDIR)/make/js.mk
|
||||||
|
include $(JWBDIR)/make/rules.mk
|
||||||
|
include $(JWBDIR)/make/dev-utils.mk
|
||||||
|
|
||||||
|
all: $(LESS_GENERATED_CSS) lint
|
||||||
|
install: install_HTML
|
||||||
|
clean: textclean localclean doneclean clean.lesscpy
|
||||||
|
test:
|
||||||
|
|
||||||
|
%.css: %.less
|
||||||
|
$(LESS_CPY) $< > $@.tmp
|
||||||
|
mv $@.tmp $@
|
||||||
|
|
||||||
|
clean.lesscpy:
|
||||||
|
$(RM) -f $(LESS_GENERATED_CSS) *.tmp
|
||||||
|
|
||||||
|
lint: $(LOCAL_HTML_LINT)
|
||||||
|
clean: lint.clean
|
||||||
|
lint.clean:
|
||||||
|
rm -f .*.lint
|
||||||
|
|
||||||
|
.%.html.lint: %.html
|
||||||
|
ifneq ($(PRETTIER),)
|
||||||
|
$(PRETTIER) $< >/dev/null
|
||||||
|
endif
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
.%.php.lint: %.php
|
||||||
|
php -l $<
|
||||||
|
ifneq ($(PRETTIER),)
|
||||||
|
#$(PRETTIER) --parser html $< >/dev/null
|
||||||
|
endif
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
.%.css.lint: %.css
|
||||||
|
ifneq ($(PRETTIER),)
|
||||||
|
$(PRETTIER) $< >/dev/null
|
||||||
|
endif
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
.%.js.lint: %.js
|
||||||
|
ifneq ($(PRETTIER),)
|
||||||
|
$(PRETTIER) $< >/dev/null
|
||||||
|
endif
|
||||||
|
touch $@
|
||||||
44
make/include.mk
Normal file
44
make/include.mk
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
include $(JWBDIR)/make/defs.mk
|
||||||
|
include $(JWBDIR)/make/defs-cpp.mk
|
||||||
|
include $(JWBDIR)/make/dev-utils.mk
|
||||||
|
|
||||||
|
# variables
|
||||||
|
SRC_H += $(PROJ_H) $(wildcard $(HDRDIR_SCOPE_SUFFIX)/*.h)
|
||||||
|
|
||||||
|
# mandatory targets
|
||||||
|
all: $(PROJ_H)
|
||||||
|
clean: clean.include
|
||||||
|
install: install_HDR
|
||||||
|
|
||||||
|
# not wäry naaice
|
||||||
|
ifneq ($(HDRDIR_SCOPE_SUFFIX),)
|
||||||
|
install_HDR: dir_install_hdr_suffix.done
|
||||||
|
|
||||||
|
dir_install_hdr_suffix.done:
|
||||||
|
$(INSTALL) -d -o $(HDRDIROWNER) -g $(HDRDIRGROUP) -m $(HDRDIRMODE) $(INSTALL_HDRDIR)/$(HDRDIR_SCOPE_SUFFIX)
|
||||||
|
touch $@
|
||||||
|
endif
|
||||||
|
|
||||||
|
# convenience targets
|
||||||
|
project-header: $(PROJ_H)
|
||||||
|
|
||||||
|
# rules
|
||||||
|
clean.include:
|
||||||
|
$(RM) -rf *.h *~ .*.swp *.done $(PROJ_H) $(HDRDIR_SCOPE_SUFFIX)
|
||||||
|
|
||||||
|
$(PROJ_H): $(filter-out $(PROJ_H) $(PROJECT)/$(PROJ_H),$(wildcard *.h $(PROJECT)/*.h))
|
||||||
|
echo "#ifndef _$(PROJECT_CAPNAME)_H" > $@.tmp
|
||||||
|
echo "#define _$(PROJECT_CAPNAME)_H" >> $@.tmp
|
||||||
|
echo >> $@.tmp
|
||||||
|
for h in $(sort $(patsubst $(PROJECT)/%,%,$^)); do echo "#include <$(PROJECT)/$$h>"; done >> $@.tmp
|
||||||
|
echo >> $@.tmp
|
||||||
|
echo "#endif /* #ifndef _$(PROJECT_CAPNAME)_H */" >> $@.tmp
|
||||||
|
mv $@.tmp $@
|
||||||
|
|
||||||
|
install-links:
|
||||||
|
DEVELOPMENT=false make do-install-links
|
||||||
|
|
||||||
|
do-install-links:
|
||||||
|
@$(call install_links,HDR)
|
||||||
|
|
||||||
|
include $(JWBDIR)/make/rules.mk
|
||||||
31
make/js.mk
Normal file
31
make/js.mk
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
JAVA ?= /usr/bin/java
|
||||||
|
JS_MINIFY_FILTER_IN ?= sed 's/console\.[a-z]\+([^)]\+) *;//g'
|
||||||
|
JS_SRC ?= $(filter-out %.min.js,$(wildcard *.js))
|
||||||
|
JS_GENERATED ?= $(patsubst %.js,%.min.js,$(JS_SRC))
|
||||||
|
JS_EXTRA_EXTERNS ?=
|
||||||
|
JS_CC_BUILD_ROOT ?= $(PROJECTS_DIR)/closure-compiler/contrib/closure-compiler/install-root
|
||||||
|
JS_EXTERNS_DIRS ?= $(firstword $(wildcard $(JS_CC_BUILD_ROOT)/$(realpath $(PROJECTS_DIR))/closure-compiler/share/externs /opt/closure-compiler/share/externs))
|
||||||
|
JS_EXTERNS ?= $(sort $(JS_EXTRA_EXTERNS) jquery-3.3.js)
|
||||||
|
JS_EXTERN_PATHS ?= $(wildcard $(foreach d,$(JS_EXTERNS_DIRS),$(addprefix $d/,$(JS_EXTERNS))))
|
||||||
|
JS_MINIFY_OPTS ?= $(addprefix --externs ,$(JS_EXTERN_PATHS)) --compilation_level ADVANCED --strict_mode_input
|
||||||
|
JS_MINIFY_EXE ?= $(JAVA) -jar $(firstword $(wildcard \
|
||||||
|
$(JS_CC_BUILD_ROOT)/usr/share/java/closure-compiler.jar \
|
||||||
|
/usr/share/java/closure-compiler.jar \
|
||||||
|
) closure-compiler.jar-not-found)
|
||||||
|
JS_MINIFY ?= $(JS_MINIFY_EXE) $(JS_MINIFY_OPTS)
|
||||||
|
|
||||||
|
# This is not nice. It requires install-files to be included from elsewhere,
|
||||||
|
# which is not obvious. OTOH, if it isn't, SOURCE_FILES doesn't do any harm,
|
||||||
|
# either.
|
||||||
|
SOURCE_FILES += $(JS_GENERATED)
|
||||||
|
|
||||||
|
all: $(JS_GENERATED)
|
||||||
|
clean: minify.clean
|
||||||
|
|
||||||
|
%.min.js: %.js
|
||||||
|
cat $< | $(JS_MINIFY_FILTER_IN) > $@.filtered
|
||||||
|
$(JS_MINIFY) $@.filtered > $@.tmp
|
||||||
|
mv $@.tmp $@
|
||||||
|
|
||||||
|
minify.clean:
|
||||||
|
rm -f $(JS_GENERATED) *.tmp *.filtered
|
||||||
96
make/lib.mk
Normal file
96
make/lib.mk
Normal file
|
|
@ -0,0 +1,96 @@
|
||||||
|
# generic utility modules
|
||||||
|
# (c) 2001 jannet it services
|
||||||
|
# contact@jannet.de
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
include $(JWBDIR)/make/defs.mk
|
||||||
|
include $(JWBDIR)/make/defs-cpp.mk
|
||||||
|
include $(JWBDIR)/make/rules.mk
|
||||||
|
include $(JWBDIR)/make/dev-utils.mk
|
||||||
|
|
||||||
|
all:
|
||||||
|
|
||||||
|
ifeq ($(wildcard $(LIB_A)),)
|
||||||
|
USE_PROJECT_LIB = false
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_PROJECT_LIB),false)
|
||||||
|
ifeq ($(TARGET),mingw)
|
||||||
|
SHOBJS += $(wildcard *.dll)
|
||||||
|
else
|
||||||
|
SHOBJS += $(wildcard *.so)
|
||||||
|
endif
|
||||||
|
all: $(LD_CONF)
|
||||||
|
install:
|
||||||
|
else
|
||||||
|
all: $(LD_CONF) $(LIB_SO) $(LINKS_SO) $(MSVCPP_IMPLIB) $(STRIP_DONE)
|
||||||
|
install: install_LIB
|
||||||
|
endif
|
||||||
|
clean: libclean local_libclean clean.ld-conf
|
||||||
|
distclean: clean
|
||||||
|
|
||||||
|
local_libclean: clean.mingw clean.unix clean.all
|
||||||
|
|
||||||
|
ifneq ($(wildcard *.so *.so.*),)
|
||||||
|
install: install_files_LD_CONF
|
||||||
|
endif
|
||||||
|
|
||||||
|
clean.unix:
|
||||||
|
ifneq ($(TARGET),mingw)
|
||||||
|
$(RM) -rf *.so.* *.so st*
|
||||||
|
endif
|
||||||
|
|
||||||
|
clean.mingw:
|
||||||
|
ifeq ($(TARGET),mingw)
|
||||||
|
$(RM) -rf *.dll *.def *.exp *.lib
|
||||||
|
endif
|
||||||
|
|
||||||
|
clean.all:
|
||||||
|
$(RM) -rf *.a *.o *~ st* .*.swp *.done ld-*.conf version.ldscript
|
||||||
|
|
||||||
|
ld-%.conf:
|
||||||
|
echo $(INSTALL_LIBDIR) > $@.tmp
|
||||||
|
mv $@.tmp $@
|
||||||
|
|
||||||
|
clean.ld-conf:
|
||||||
|
$(RM) -f $(LD_CONF)
|
||||||
|
|
||||||
|
echo.libs:
|
||||||
|
@echo INSTALLED_LIB_SO = $(INSTALLED_LIB_SO)
|
||||||
|
@echo INSTALLED_LIB = $(INSTALLED_LIB)
|
||||||
|
|
||||||
|
install-links:
|
||||||
|
l=$(shell $(PWD))/$(notdir $(INSTALLED_LIB_SO)) ;\
|
||||||
|
cd $(dir $(INSTALLED_LIB_SO)) &&\
|
||||||
|
sudo ln -sf $$l
|
||||||
|
# ------------------------------------------ contrib libraries
|
||||||
|
# deps on mandatory targets
|
||||||
|
all: $(CONTRIB_LIBS)
|
||||||
|
clean: clean.contrib-libs
|
||||||
|
|
||||||
|
# deps on optional targets
|
||||||
|
echo-contrib: echo.contrib-libs echo.libs
|
||||||
|
|
||||||
|
# rules
|
||||||
|
clean.contrib-libs:
|
||||||
|
$(RM) -f $(CONTRIB_LIBS)
|
||||||
|
|
||||||
|
define contrib_lib_search_rules
|
||||||
|
%.dll: $(1)/%.dll
|
||||||
|
cp -p $$< $$@
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(foreach p,$(CONTRIB_LIBS_PATH),$(eval $(call contrib_lib_search_rules,$(p))))
|
||||||
|
|
||||||
|
echo.contrib-libs:
|
||||||
|
@echo CONTRIB_LIBS_PATH = $(CONTRIB_LIBS_PATH)
|
||||||
|
@echo CONTRIB_LIBS = $(CONTRIB_LIBS)
|
||||||
|
|
||||||
|
ifeq ($(TARGET),mingw)
|
||||||
|
clean.winres:
|
||||||
|
$(RM) -f $(WINRES_RC) $(WINRES_O) *.tmp
|
||||||
|
|
||||||
|
clean: clean.winres
|
||||||
|
#%.o : %.rc
|
||||||
|
# $(WINDRES) $^ -o $@
|
||||||
|
endif
|
||||||
72
make/lo.mk
Normal file
72
make/lo.mk
Normal file
|
|
@ -0,0 +1,72 @@
|
||||||
|
# === pre-define these >
|
||||||
|
TOOLS_DIR ?= $(TOPDIR)/tools
|
||||||
|
TOOLS_INCLUDE_DIR ?= $(TOOLS_DIR)
|
||||||
|
CPP_PREFIX ?= YLo
|
||||||
|
CPP_SUFFIX ?=
|
||||||
|
SO_PREFIX ?= lo_
|
||||||
|
LOADABLE_OBJ_HOOK ?= LOADABLE_OBJECT_HOOK
|
||||||
|
LOADABLE_OBJ_IGNORE ?=
|
||||||
|
# === pre-define these <
|
||||||
|
|
||||||
|
include $(JWBDIR)/make/defs.mk
|
||||||
|
include $(JWBDIR)/make/defs-cpp.mk
|
||||||
|
include $(JWBDIR)/make/profiler-defs.mk
|
||||||
|
include $(JWBDIR)/make/dev-utils.mk
|
||||||
|
|
||||||
|
.PRECIOUS: %.cpp %.o
|
||||||
|
LOADABLE_OBJS_HEADER ?= $(wildcard $(TOOLS_INCLUDE_DIR)/$(CPP_PREFIX)*$(CPP_SUFFIX).h)
|
||||||
|
LOADABLE_OBJS_BASE ?= $(patsubst %$(CPP_SUFFIX),%,$(patsubst $(CPP_PREFIX)%,%,$(basename $(notdir $(LOADABLE_OBJS_HEADER)))))
|
||||||
|
LOADABLE_OBJS = $(filter-out $(LOADABLE_OBJ_IGNORE),$(LOADABLE_OBJS_BASE))
|
||||||
|
LOADABLE_OBJ_CPP = $(patsubst %,%.cpp,$(LOADABLE_OBJS))
|
||||||
|
LOADABLE_OBJS_O = $(patsubst %,%.o,$(LOADABLE_OBJS))
|
||||||
|
|
||||||
|
OTHER_CPP_IGNORE += $(patsubst %,$(CPP_PREFIX)%.cpp,$(LOADABLE_OBJ_IGNORE)) $(patsubst %,%.cpp,$(LOADABLE_OBJ_IGNORE))
|
||||||
|
SRC_ALL_CPP_IGNORE += $(OTHER_CPP_IGNORE)
|
||||||
|
OTHER_CPP ?= $(filter-out $(LOADABLE_OBJ_CPP) $(OTHER_CPP_IGNORE),$(wildcard *.cpp))
|
||||||
|
ifneq ($(OTHER_CPP),)
|
||||||
|
OTHER_O = $(patsubst %.cpp,%.o,$(OTHER_CPP))
|
||||||
|
OTHER_LIB = liblocal.a
|
||||||
|
OTHER_LIB_LDFLAGS = -L. -llocal
|
||||||
|
OTHER_MEMBERS_O = $(OTHER_LIB)($(OTHER_O))
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(TARGET),mingw)
|
||||||
|
LOADABLE_OBJ_LIBS = $(addprefix $(SO_PREFIX), $(addsuffix .so, $(LOADABLE_OBJS)))
|
||||||
|
else
|
||||||
|
LOADABLE_OBJ_LIBS = $(addprefix $(SO_PREFIX), $(addsuffix .dll, $(LOADABLE_OBJS)))
|
||||||
|
endif
|
||||||
|
BUILD_LOADABLE_OBJ_LIBS = $(addprefix $(BUILD_LIBDIR)/,$(LOADABLE_OBJ_LIBS))
|
||||||
|
INSTALLED_LOADABLE_OBJ_LIBS = $(addprefix $(INSTALL_LIBDIR)/,$(LOADABLE_OBJ_LIBS))
|
||||||
|
|
||||||
|
all: $(LOADABLE_OBJ_LIBS) $(BUILD_LOADABLE_OBJ_LIBS)
|
||||||
|
install: $(INSTALLED_LOADABLE_OBJ_LIBS)
|
||||||
|
clean: clean.lo
|
||||||
|
|
||||||
|
clean.generated:
|
||||||
|
$(RM) -f $(patsubst $(CPP_PREFIX)%$(CPP_SUFFIX),%,$(notdir $(patsubst %.h,%.cpp,$(LOADABLE_OBJS_HEADER))))
|
||||||
|
|
||||||
|
clean.lo: profclean clean.generated
|
||||||
|
$(RM) -f $(wildcard *.o *.so *.done *.dll $(OTHER_LIB))
|
||||||
|
|
||||||
|
$(SO_PREFIX)%.so $(SO_PREFIX)%.dll: %.o $(CPP_PREFIX)%.o $(OTHER_LIB)
|
||||||
|
$(CXX) $^ -L. $(OTHER_LIB_LDFLAGS) -shared $(FINAL_LDFLAGS) -o $@
|
||||||
|
|
||||||
|
%.cpp: $(TOOLS_INCLUDE_DIR)/$(CPP_PREFIX)%$(CPP_SUFFIX).h
|
||||||
|
echo "#include \"$<\"" > $@.tmp
|
||||||
|
if [ "$(LO_NAMESPACE)" ]; then echo "using namespace $(LO_NAMESPACE);" >> $@.tmp; fi
|
||||||
|
echo "$(LOADABLE_OBJ_HOOK)($(CPP_PREFIX)$*$(CPP_SUFFIX));" >> $@.tmp
|
||||||
|
mv $@.tmp $@
|
||||||
|
|
||||||
|
$(OTHER_LIB)(%.o): %.o
|
||||||
|
$(AR) rU $(OTHER_LIB) $<
|
||||||
|
$(RANLIB) $(OTHER_LIB)
|
||||||
|
|
||||||
|
$(OTHER_LIB): $(OTHER_MEMBERS_O)
|
||||||
|
|
||||||
|
$(BUILD_LIBDIR)/%.so: %.so
|
||||||
|
install -m 755 $< $@
|
||||||
|
$(BUILD_LIBDIR)/%.dll: %.dll
|
||||||
|
install -m 755 $< $@
|
||||||
|
|
||||||
|
include $(JWBDIR)/make/rules.mk
|
||||||
|
include $(JWBDIR)/make/depend.mk
|
||||||
4
make/path-rules.mk
Normal file
4
make/path-rules.mk
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
all:
|
||||||
|
libpath:
|
||||||
|
@echo "export LD_LIBRARY_PATH=$(LD_LIBRARY_PATH)"
|
||||||
|
@echo "export PATH=.:$(PATH)"
|
||||||
30
make/profiler-defs.mk
Normal file
30
make/profiler-defs.mk
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
all:
|
||||||
|
clean:
|
||||||
|
|
||||||
|
PROF_EXE_PATH ?= $(EXE_PATH)
|
||||||
|
CALLGRIND_OUT ?= callgrind.out
|
||||||
|
OPROF_OUT_DIR ?= oprofile-data
|
||||||
|
|
||||||
|
ifeq ($(USE_GPROF),true)
|
||||||
|
FINAL_CXXFLAGS += -pg
|
||||||
|
FINAL_CFLAGS += -pg
|
||||||
|
FINAL_LDFLAGS += -pg
|
||||||
|
clean: clean.gprof
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(COMPILER_SUITE),gcc)
|
||||||
|
ifeq ($(USE_GCOV),true)
|
||||||
|
FINAL_CXXFLAGS += -fprofile-arcs -ftest-coverage
|
||||||
|
FINAL_CFLAGS += -fprofile-arcs -ftest-coverage
|
||||||
|
FINAL_LDFLAGS += -fprofile-arcs -ftest-coverage
|
||||||
|
clean: clean.gcov
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(COMPILER_SUITE),clang)
|
||||||
|
ifeq ($(USE_XRAY),true)
|
||||||
|
FINAL_CXXFLAGS += -fxray-instrument -fxray-instruction-threshold=1
|
||||||
|
FINAL_CFLAGS += -fxray-instrument -fxray-instruction-threshold=1
|
||||||
|
#FINAL_LDFLAGS += -fxray-instrument
|
||||||
|
endif
|
||||||
|
endif
|
||||||
84
make/profiler-rules-run.mk
Normal file
84
make/profiler-rules-run.mk
Normal file
|
|
@ -0,0 +1,84 @@
|
||||||
|
# ---- callgrind
|
||||||
|
|
||||||
|
clean: clean.callgrind
|
||||||
|
|
||||||
|
callgrind: run-deps
|
||||||
|
$(RM) -f core.*
|
||||||
|
valgrind --tool=callgrind $(VALGRIND_OPTS) $(EXE_PATH) $(EXE_ARGS)
|
||||||
|
callgrind-noinst: run-deps
|
||||||
|
$(RM) -f core.*
|
||||||
|
valgrind --tool=callgrind --callgrind-out-file=$(CALLGRIND_OUT) --instr-atstart=no $(VALGRIND_OPTS) $(EXE_PATH) $(EXE_ARGS)
|
||||||
|
$(CALLGRIND_OUT): callgrind
|
||||||
|
kcachegrind: $(CALLGRIND_OUT)
|
||||||
|
kcachegrind $<
|
||||||
|
callgrind-startinst:
|
||||||
|
ps aux | grep callgrind | grep -v "grep\|make\|callgrind_control" | awk '{print $$2}' | xargs callgrind_control --instr=on
|
||||||
|
callgrind-stopinst:
|
||||||
|
ps aux | grep callgrind | grep -v "grep\|make\|callgrind_control" | awk '{print $$2}' | xargs callgrind_control --instr=off
|
||||||
|
callgrind-dump:
|
||||||
|
ps aux | grep callgrind | grep -v "grep\|make\|callgrind_control" | awk '{print $$2}' | xargs callgrind_control --dump
|
||||||
|
clean.callgrind:
|
||||||
|
$(RM) -f $(CALLGRIND_OUT)
|
||||||
|
|
||||||
|
# ---- oprofile
|
||||||
|
|
||||||
|
clean: clean.oprof
|
||||||
|
|
||||||
|
operf: | $(OPROF_OUT_DIR)
|
||||||
|
|
||||||
|
$(OPROF_OUT_DIR):
|
||||||
|
mkdir -p $@
|
||||||
|
oprof-setup:
|
||||||
|
echo 0 | sudo tee /proc/sys/kernel/kptr_restrict
|
||||||
|
echo 0 | sudo tee /proc/sys/kernel/perf_event_paranoid
|
||||||
|
oprof-callgraph.txt:
|
||||||
|
opreport --session-dir $(OPROF_OUT_DIR) --callgraph > $@.tmp
|
||||||
|
mv $@.tmp $@
|
||||||
|
oprof-view-callgraph-txt: oprof-callgraph.txt
|
||||||
|
less -S $<
|
||||||
|
oprof-callgraph.dot: oprof-callgraph.txt
|
||||||
|
cat $< | gprof2dot -f oprofile > $@.tmp
|
||||||
|
mv $@.tmp $@
|
||||||
|
oprof-callgraph.pdf: oprof-callgraph.dot
|
||||||
|
dot -Tpdf $< -o $@.tmp
|
||||||
|
mv $@.tmp $@
|
||||||
|
oprof-view-callgraph-pdf: oprof-callgraph.pdf
|
||||||
|
okular $<
|
||||||
|
oprof-view-callgraph-dot: oprof-callgraph.dot
|
||||||
|
xdot $<
|
||||||
|
|
||||||
|
#operf: operf.txt
|
||||||
|
#operf.txt:
|
||||||
|
# operf --session-dir $(OPROF_OUT_DIR) $(PROF_CMD)
|
||||||
|
#operf-view-txt: operf.txt
|
||||||
|
# less -S $<
|
||||||
|
#operf-callgraph.pdf: gmon.out
|
||||||
|
# operf $(PROF_EXE_PATH) | operf2dot | dot -Tpdf -o $@.tmp
|
||||||
|
# mv $@.tmp $@
|
||||||
|
#operf-pdf: operf-callgraph.pdf
|
||||||
|
|
||||||
|
clean.oprof:
|
||||||
|
$(RM) -rf $(OPROF_OUT_DIR) oprof-callgraph.txt oprof-callgraph.pdf oprof-callgraph.dot
|
||||||
|
|
||||||
|
# ---- gcov
|
||||||
|
|
||||||
|
clean.gcov:
|
||||||
|
$(RM) -f *.gcda *.gcov
|
||||||
|
|
||||||
|
# ---- gprof
|
||||||
|
|
||||||
|
clean: clean.gprof
|
||||||
|
gprof: gprof.txt
|
||||||
|
gprof.txt:
|
||||||
|
gprof $(PROF_EXE_PATH) > $@.tmp
|
||||||
|
mv $@.tmp $@
|
||||||
|
gprof-view-txt: gprof.txt
|
||||||
|
less -S $<
|
||||||
|
gprof-callgraph.pdf: gmon.out
|
||||||
|
gprof $(PROF_EXE_PATH) | gprof2dot | dot -Tpdf -o $@.tmp
|
||||||
|
mv $@.tmp $@
|
||||||
|
gprof-pdf: gprof-callgraph.pdf
|
||||||
|
gprof-view-callgraph-pdf: gprof-callgraph.pdf
|
||||||
|
okular $<
|
||||||
|
clean.gprof:
|
||||||
|
$(RM) -f gmon.out gprof.txt *.tmp gprof-callgraph.pdf
|
||||||
2
make/profiler.mk
Normal file
2
make/profiler.mk
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
include $(JWBDIR)/make/profiler-defs.mk
|
||||||
|
include $(JWBDIR)/make/profiler-rules-run.mk
|
||||||
166
make/run.mk
Normal file
166
make/run.mk
Normal file
|
|
@ -0,0 +1,166 @@
|
||||||
|
# generic utility modules
|
||||||
|
# (c) 2001 jannet it services
|
||||||
|
# contact@jannet.de
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
include $(JWBDIR)/make/defs.mk
|
||||||
|
include $(JWBDIR)/make/defs-cpp.mk
|
||||||
|
|
||||||
|
DIR_BASENAME = $(notdir $(CWD))
|
||||||
|
|
||||||
|
ifneq ($(TARGET_PRODUCT),)
|
||||||
|
EXE_BASENAME_PREFIX ?= $(TARGET_PRODUCT)-
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(EXE_BASENAME),)
|
||||||
|
ifneq ($(DIR_BASENAME),test)
|
||||||
|
EXE_BASENAME = $(EXE_BASENAME_PREFIX)$(DIR_BASENAME)
|
||||||
|
else
|
||||||
|
EXE_BASENAME = $(EXE_BASENAME_PREFIX)test-$(notdir $(shell cd ..; $(PWD)))
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(EXE_BASENAME),)
|
||||||
|
ifneq ($(TARGET),mingw)
|
||||||
|
EXE ?= $(EXE_BASENAME)
|
||||||
|
SHORTCUT_SCRIPT ?= ./run.sh
|
||||||
|
else
|
||||||
|
EXE ?= $(EXE_BASENAME).exe
|
||||||
|
SHORTCUT_SCRIPT ?= run.bat
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
EXE_PATH ?= ./$(EXE)
|
||||||
|
CHECK_CONF_EXE ?= $(firstword $(wildcard $(PROJECTS_DIR)/valdi/bin/checkconf) checkconf)
|
||||||
|
|
||||||
|
FINAL_CFLAGS += -DEXE_NAME=\"$(EXE)\"
|
||||||
|
FINAL_CXXFLAGS += -DEXE_NAME=\"$(EXE)\"
|
||||||
|
|
||||||
|
# ----- linker scripts from tagged templates
|
||||||
|
#BUILD_LD_DIR = $(wildcard $(firstword $(call $(TAGGED_TMPL_DIRS),ld)))
|
||||||
|
#BUILD_LD_DIR = $(firstword $(foreach tag,$(TAGGED_TMPL_TAGS),$(foreach repo,$(TOPDIR)/tmpl/tagged $(JWBDIR)/tmpl/tagged,$(wildcard $(repo)/$(tag)/ld))))
|
||||||
|
#BUILD_LD_DIR = $(firstword $(wildcard $(foreach tag,$(TAGGED_TMPL_TAGS),$(foreach repo,$(TOPDIR)/tmpl/tagged $(JWBDIR)/tmpl/tagged,$(repo)/$(tag)/ld))))
|
||||||
|
|
||||||
|
#BUILD_LD_TMPL_DIRS ?= $(foreach tag,$(TAGGED_TMPL_TAGS),$(foreach repo,$(TOPDIR)/tmpl/tagged $(JWBDIR)/tmpl/tagged,$(repo)/$(tag)/ld))
|
||||||
|
#BUILD_LD_DIRS += $(wildcard $(BUILD_LD_TMPL_DIRS))
|
||||||
|
#FINAL_LDFLAGS += $(foreach d,$(BUILD_LD_DIRS),-L$(d) $(addprefix -T ,$(sort $(notdir $(wildcard $(d)/*.ld)))))
|
||||||
|
|
||||||
|
BUILD_LD_DIRS = $(call uniq,$(dir $(foreach d,$(BUILD_LD_CHECK_DIRS),$(wildcard $(d)/*.ld))))
|
||||||
|
LD_SCRIPTS = $(foreach d,$(BUILD_LD_DIRS),$(wildcard $(d)/*.ld))
|
||||||
|
FINAL_LDFLAGS += $(foreach d,$(BUILD_LD_DIRS),-L$(d) $(addprefix -T ,$(sort $(notdir $(wildcard $(d)/*.ld)))))
|
||||||
|
|
||||||
|
include $(JWBDIR)/make/profiler.mk
|
||||||
|
include $(JWBDIR)/make/rules.mk
|
||||||
|
include $(JWBDIR)/make/ldlibpath.mk
|
||||||
|
include $(JWBDIR)/make/path-rules.mk
|
||||||
|
include $(JWBDIR)/make/debugger.mk
|
||||||
|
|
||||||
|
EXE_ARGS += $(LOCAL_EXE_ARGS)
|
||||||
|
EXE_CMD ?= $(EXE_PATH) $(EXE_ARGS)
|
||||||
|
|
||||||
|
ifneq ($(wildcard local.supp),)
|
||||||
|
VALGRIND_OPTS += --suppressions=local.supp
|
||||||
|
endif
|
||||||
|
|
||||||
|
all:
|
||||||
|
install:
|
||||||
|
clean: runclean localclean
|
||||||
|
distclean:
|
||||||
|
|
||||||
|
run-deps: all
|
||||||
|
$(RM) -f core core.* vgcore vgcore.*
|
||||||
|
|
||||||
|
ifeq ($(TARGET),mingw)
|
||||||
|
run test: run-deps
|
||||||
|
@echo "wine $(EXE_CMD)"
|
||||||
|
@echo -e "set PATH=%PATH;$(DLL_PATH)\n" \
|
||||||
|
"$(EXE_CMD)" | wine cmd
|
||||||
|
|
||||||
|
start: run-deps
|
||||||
|
@echo "wine $(EXE_CMD)"
|
||||||
|
@echo -e "set PATH=%PATH;$(DLL_PATH)\n" \
|
||||||
|
"$(EXE_CMD)" | wine cmd &
|
||||||
|
|
||||||
|
else
|
||||||
|
run test: run-deps
|
||||||
|
$(EXE_CMD)
|
||||||
|
start: run-deps
|
||||||
|
$(EXE_CMD) &
|
||||||
|
|
||||||
|
which:
|
||||||
|
$(WHICH) $(EXE_PATH)
|
||||||
|
|
||||||
|
$(SHORTCUT_SCRIPT):
|
||||||
|
ifeq ($(TARGET),mingw)
|
||||||
|
echo "set PATH=%PATH;$(DLL_PATH)" > $@.tmp
|
||||||
|
echo "$(EXE_CMD)" >> $@.tmp
|
||||||
|
else
|
||||||
|
echo -e "#!/bin/bash\n\n$(RM) -f core.*\nexport LD_LIBRARY_PATH=$(LD_LIBRARY_PATH)\nexport PATH=$(PATH)\n$(EXE_CMD)" > $@.tmp
|
||||||
|
chmod 755 $@.tmp
|
||||||
|
endif
|
||||||
|
mv $@.tmp $@
|
||||||
|
shortcut: $(SHORTCUT_SCRIPT)
|
||||||
|
distclean.shortcut:
|
||||||
|
$(RM) -f $(SHORTCUT_SCRIPT)
|
||||||
|
distclean: distclean.shortcut
|
||||||
|
|
||||||
|
# unfortunately iwatch supports only one directory :-(
|
||||||
|
autorun:
|
||||||
|
make run &
|
||||||
|
iwatch -e close_write -c "$(HOME)/bin/run-once.sh make restart" \
|
||||||
|
$(BUILD_LIBDIR)
|
||||||
|
|
||||||
|
wait-stop:
|
||||||
|
while /sbin/checkproc $(notdir $(EXE_PATH)); do sleep 1; done
|
||||||
|
|
||||||
|
restart: stop wait-stop all start
|
||||||
|
|
||||||
|
valgrind: run-deps
|
||||||
|
valgrind $(VALGRIND_OPTS) $(EXE_CMD)
|
||||||
|
|
||||||
|
valkyrie: run-deps
|
||||||
|
valkyrie $(VALGRIND_OPTS) $(EXE_CMD)
|
||||||
|
|
||||||
|
efence: run-deps
|
||||||
|
ef $(EXE_CMD)
|
||||||
|
|
||||||
|
supp.tmp:
|
||||||
|
valgrind --gen-suppressions=all $(EXE_CMD) 2>$@.tmp; mv $@.tmp $@ || exit 0
|
||||||
|
|
||||||
|
vg-create-supp: supp.tmp
|
||||||
|
$(CAT) $< | $(JWB_SCRIPT_DIR)/parse-valgrind-suppressions.sh > local.supp
|
||||||
|
$(RM) -f supp.tmp
|
||||||
|
vg-add-supp:
|
||||||
|
$(CAT) | $(JWB_SCRIPT_DIR)/parse-valgrind-suppressions.sh >> local.supp
|
||||||
|
clean: vg-clean-supp
|
||||||
|
vg-clean-supp:
|
||||||
|
$(RM) -f local.supp
|
||||||
|
|
||||||
|
clean: clean.out
|
||||||
|
clean.out:
|
||||||
|
$(RM) -f run.out
|
||||||
|
|
||||||
|
snap:
|
||||||
|
killall -SIGUSR1 $(notdir $(EXE_PATH))
|
||||||
|
|
||||||
|
check-conf:
|
||||||
|
$(CHECK_CONF_EXE) -p --log-flags console \
|
||||||
|
$(shell echo $(EXE_ARGS) | sed 's/.*--config-file *//; s/ .*//')
|
||||||
|
endif
|
||||||
|
|
||||||
|
stop:
|
||||||
|
if /sbin/checkproc $(notdir $(EXE_PATH)); then killall $(notdir $(EXE_PATH)); fi
|
||||||
|
kill:
|
||||||
|
killall -9 $(notdir $(EXE_PATH))
|
||||||
|
|
||||||
|
abort:
|
||||||
|
killall -6 $(notdir $(EXE_PATH))
|
||||||
|
|
||||||
|
strace: $(EXE_PATH) $(EXE_BIN) run-deps
|
||||||
|
strace -f $(STRACE_EXTRA_OPTS) $(EXE_CMD)
|
||||||
|
|
||||||
|
tee: $(EXE_PATH) $(EXE_BIN) run-deps
|
||||||
|
$(EXE_CMD) 2>&1 | tee run.out
|
||||||
|
|
||||||
|
kcg:
|
||||||
|
kcachegrind callgrind.*
|
||||||
24
make/so.mk
Normal file
24
make/so.mk
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
# generic utility modules
|
||||||
|
# (c) 2001 jannet it services
|
||||||
|
# contact@jannet.de
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
include $(JWBDIR)/make/defs.mk
|
||||||
|
include $(JWBDIR)/make/defs-cpp.mk
|
||||||
|
|
||||||
|
LDFLAGS += -shared
|
||||||
|
BUILD_SHOBJS = $(addprefix $(BUILD_LIBDIR)/, $(SHOBJS))
|
||||||
|
SHOBJS = $(patsubst %.cpp,$(SO_PREFIX)%.so,$(patsubst %.cc,$(SO_PREFIX)%.so,$(patsubst %.c,$(SO_PREFIX)%.so,$(SRC_ALL_CPP))))
|
||||||
|
INSTALLED_SHOBJS += $(addprefix $(INSTALL_LIBDIR)/,$(SHOBJS))
|
||||||
|
INSTALLED_ALL_LIBS += $(INSTALLED_SHOBJS)
|
||||||
|
|
||||||
|
include $(JWBDIR)/make/ldlibpath.mk
|
||||||
|
include $(JWBDIR)/make/debugger.mk
|
||||||
|
include $(JWBDIR)/make/rules.mk
|
||||||
|
|
||||||
|
all: $(SHOBJS) $(BUILD_SHOBJS)
|
||||||
|
clean: objclean textclean localclean profclean
|
||||||
|
install: $(ALL) install_dir_LIB installso
|
||||||
|
|
||||||
|
$(BUILD_LIBDIR)/%.so: %.so
|
||||||
|
install -m 755 $< $@
|
||||||
34
make/std-tools.mk
Normal file
34
make/std-tools.mk
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
include $(JWBDIR)/make/defs.mk
|
||||||
|
|
||||||
|
PROFILE_SH = profile-$(PROJECT).sh
|
||||||
|
|
||||||
|
all: $(PROFILE_SH)
|
||||||
|
clean: clean.std-tools
|
||||||
|
install: $(PROFILE_SH) install.std-tools.done
|
||||||
|
distclean: clean
|
||||||
|
|
||||||
|
$(PROFILE_SH): $(LOCAL_MKFILES)
|
||||||
|
echo '#!/bin/sh' > $@.tmp
|
||||||
|
echo "if [ \"\$$PATH\" ]; then" >> $@.tmp
|
||||||
|
echo " PATH=\$$PATH:$(INSTALL_EXEDIR)" >> $@.tmp
|
||||||
|
echo "else" >> $@.tmp
|
||||||
|
echo " PATH=$(INSTALL_EXEDIR)" >> $@.tmp
|
||||||
|
echo "fi" >> $@.tmp
|
||||||
|
echo "if [ \"\$$LD_LIBRARY_PATH\" ]; then" >> $@.tmp
|
||||||
|
echo " LD_LIBRARY_PATH=\$$LD_LIBRARY_PATH:$(INSTALL_LIBDIR)" >> $@.tmp
|
||||||
|
echo "else" >> $@.tmp
|
||||||
|
echo " LD_LIBRARY_PATH=$(INSTALL_LIBDIR)" >> $@.tmp
|
||||||
|
echo "fi" >> $@.tmp
|
||||||
|
echo "export PATH LD_LIBRARY_PATH" >> $@.tmp
|
||||||
|
mv $@.tmp $@
|
||||||
|
|
||||||
|
clean.std-tools:
|
||||||
|
$(RM) -f $(PROFILE_SH) *.done
|
||||||
|
|
||||||
|
install.std-tools.done: install.std-dir.done
|
||||||
|
$(INSTALL) -p -o $(PROFILEOWNER) -g $(PROFILEGROUP) -m $(PROFILEMODE) $(PROFILE_SH) $(PROFILE_DIR)
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
install.std-dir.done:
|
||||||
|
mkdir -p $(PROFILE_DIR)
|
||||||
|
touch $@
|
||||||
16
make/subdirs.mk
Normal file
16
make/subdirs.mk
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
include $(JWBDIR)/make/defs.mk
|
||||||
|
include $(JWBDIR)/make/defs-dirs.mk
|
||||||
|
|
||||||
|
all:
|
||||||
|
clean: clean.var
|
||||||
|
distclean: clean.var distclean.var
|
||||||
|
|
||||||
|
all install clean distclean test:
|
||||||
|
ifneq ($(SUBDIRS_TO_ITERATE),)
|
||||||
|
set -e; for dir in $(SUBDIRS_TO_ITERATE); do make -C $$dir $@; done
|
||||||
|
endif
|
||||||
|
|
||||||
|
clean.var:
|
||||||
|
$(RM) -rf $(CLEAN)
|
||||||
|
distclean.var:
|
||||||
|
$(RM) -rf $(DISTCLEAN)
|
||||||
59
make/svg.mk
Normal file
59
make/svg.mk
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
SVG_GENERATE_FORMATS ?= png svg
|
||||||
|
SVG ?= $(filter-out copied-%,$(wildcard *.svg))
|
||||||
|
COPIED_SVG = $(addprefix copied-,$(notdir $(SVG)))
|
||||||
|
INKSCAPE_VERSION = $(shell export -n DISPLAY; inkscape -V 2>&1 | sed '/Inkscape/ !d; s/Inkscape *\([0-9.]\+\) .*/\1/')
|
||||||
|
INKSCAPE_VERSION_MAJOR = $(word 1,$(subst ., ,$(INKSCAPE_VERSION)))
|
||||||
|
ifeq ($(INKSCAPE_VERSION_MAJOR),1)
|
||||||
|
INKSCAPE_EXPORT_PNG = --export-filename
|
||||||
|
else
|
||||||
|
INKSCAPE_EXPORT_PNG = --export-png
|
||||||
|
endif
|
||||||
|
|
||||||
|
GENERATED_ICON_WIDTHS += 16 32 48 64 72 96 128 144 168 192
|
||||||
|
GENERATED_WIDTHS ?= $(GENERATED_ICON_WIDTHS) $(GENERATED_EXTRA_WIDTHS)
|
||||||
|
|
||||||
|
ifneq ($(filter png,$(SVG_GENERATE_FORMATS)),)
|
||||||
|
GENERATED_WIDTHS_PNG ?= $(GENERATED_WIDTHS)
|
||||||
|
GENERATED_PNG ?= \
|
||||||
|
$(foreach w, $(GENERATED_WIDTHS_PNG),$(patsubst %.svg,%-$w.png,$(notdir $(SVG))))
|
||||||
|
GENERATED_IMAGES += $(GENERATED_PNG)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(filter ico,$(SVG_GENERATE_FORMATS)),)
|
||||||
|
GENERATED_WIDTHS_ICO ?= 16 32
|
||||||
|
GENERATED_ICO ?= \
|
||||||
|
$(foreach w, $(GENERATED_WIDTHS_ICO),$(patsubst %.svg,%-$w.ico,$(notdir $(SVG))))
|
||||||
|
GENERATED_IMAGES += $(GENERATED_ICO)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(filter pdf,$(SVG_GENERATE_FORMATS)),)
|
||||||
|
GENERATED_PDF ?= $(patsubst %.svg,%.pdf,$(notdir $(SVG)))
|
||||||
|
GENERATED_IMAGES += $(GENERATED_PDF)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(filter svg,$(SVG_GENERATE_FORMATS)),)
|
||||||
|
IMAGES += $(notdir $(SVG))
|
||||||
|
endif
|
||||||
|
|
||||||
|
all: $(GENERATED_IMAGES)
|
||||||
|
install:
|
||||||
|
clean: clean.images
|
||||||
|
distclean:
|
||||||
|
|
||||||
|
clean.images:
|
||||||
|
$(RM) -f $(GENERATED_IMAGES) $(COPIED_SVG)
|
||||||
|
|
||||||
|
%.png: $(COPIED_SVG)
|
||||||
|
export -n DISPLAY; inkscape -w $(shell echo $* | sed 's/.*-//') \
|
||||||
|
$(INKSCAPE_EXPORT_PNG)=$@ copied-$(shell echo $* | sed 's/-[0-9]\+$$//').svg
|
||||||
|
|
||||||
|
%.pdf: copied-%.svg
|
||||||
|
export -n DISPLAY; inkscape --export-filename="$@" $<
|
||||||
|
|
||||||
|
copied-%.svg: $(SVG)
|
||||||
|
@echo $^
|
||||||
|
cp $(filter %$*.svg, $^) $@.tmp
|
||||||
|
mv $@.tmp $@
|
||||||
|
|
||||||
|
%.ico: %.png
|
||||||
|
icotool -o $@ -c $<
|
||||||
105
make/targets-tools.mk
Normal file
105
make/targets-tools.mk
Normal file
|
|
@ -0,0 +1,105 @@
|
||||||
|
# generic utility modules
|
||||||
|
# (c) 2001 jannet it services
|
||||||
|
# contact@jannet.de
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
ifndef TARGETS_TOOLS_MK_INCLUDED
|
||||||
|
TARGETS_TOOLS_MK_INCLUDED = true
|
||||||
|
|
||||||
|
include $(JWBDIR)/make/rules.mk
|
||||||
|
|
||||||
|
ifneq ($(strip $(SRC_ALL_CPP)),)
|
||||||
|
|
||||||
|
# mandatory targets
|
||||||
|
all:
|
||||||
|
# all.link
|
||||||
|
install: $(ALL)
|
||||||
|
|
||||||
|
# convenience targets
|
||||||
|
#link: all.link
|
||||||
|
clean-link: clean.link
|
||||||
|
|
||||||
|
#all.link: $(HDRDIR_SCOPE_SUFFIX)
|
||||||
|
|
||||||
|
$(HDRDIR_SCOPE_SUFFIX):
|
||||||
|
mkdir -p $(dir $(HDRDIR_SCOPE_SUFFIX))
|
||||||
|
ln -s $(shell realpath -m . --relative-to $(dir $(HDRDIR_SCOPE_SUFFIX))) $@
|
||||||
|
|
||||||
|
ifeq ($(SCOPE_PREFIX),)
|
||||||
|
#all.link: $(BUILD_HDRDIR)/$(HDRDIR_SCOPE_SUFFIX)
|
||||||
|
|
||||||
|
#$(BUILD_HDRDIR)/$(HDRDIR_SCOPE_SUFFIX):
|
||||||
|
# cd $(BUILD_HDRDIR_BASE) && ln -s . $(HDRDIR_SCOPE_SUFFIX)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(TARGET),mingw)
|
||||||
|
$(LIB_SO): $(BUILD_OBJ)
|
||||||
|
endif
|
||||||
|
|
||||||
|
all.done: $(PREREQ_DONE) $(BUILD_HDR) $(BUILD_EXE_SH) $(MEMBERS) $(LIB_A) | $(HDRDIR_SCOPE_SUFFIX)
|
||||||
|
|
||||||
|
ifneq ($(TARGET),mingw)
|
||||||
|
all.done: $(LIB_SO)
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
clean: objclean textclean localclean profclean clean.link
|
||||||
|
|
||||||
|
clean.link:
|
||||||
|
if [ -L "$(HDRDIR_SCOPE_SUFFIX)" -a "`realpath --relative-to . $(HDRDIR_SCOPE_SUFFIX) 2>/dev/null`" = . ]; then \
|
||||||
|
rm $(HDRDIR_SCOPE_SUFFIX) ;\
|
||||||
|
rmdir -p $(dir $(HDRDIR_SCOPE_SUFFIX)) 2>/dev/null || : ;\
|
||||||
|
fi
|
||||||
|
|
||||||
|
CLANG_TIDY_H_C_CPP := $(shell $(ECHO) $(LOCAL_H) | xargs -r $(GREP) -l 'extern *"C"')
|
||||||
|
CLANG_TIDY_H_C := $(wildcard [a-z]*.h)
|
||||||
|
CLANG_TIDY_H_CPP := $(wildcard [A-Z]*.h)
|
||||||
|
#CLANG_TIDY_H_CPP := $(filter-out $(CLANG_TIDY_H_C),$(LOCAL_H))
|
||||||
|
|
||||||
|
# false positives on assert(), see https://reviews.llvm.org/D31130
|
||||||
|
CLANG_TIDY_EXTRA_ARGS += -cppcoreguidelines-pro-bounds-array-to-pointer-decay
|
||||||
|
|
||||||
|
# keep va_args
|
||||||
|
CLANG_TIDY_EXTRA_ARGS += -cppcoreguidelines-pro-type-vararg
|
||||||
|
|
||||||
|
# keep pointer arithmetic
|
||||||
|
CLANG_TIDY_EXTRA_ARGS += -cppcoreguidelines-pro-bounds-pointer-arithmetic
|
||||||
|
|
||||||
|
# don't have GSL (for now)
|
||||||
|
CLANG_TIDY_EXTRA_ARGS += -cppcoreguidelines-pro-bounds-constant-array-index
|
||||||
|
|
||||||
|
CLANG_TIDY_FILTER = $(SED) 's%\[\([a-z-]\+\)\]$$%[https://clang.llvm.org/extra/clang-tidy/checks/\1.html]%'
|
||||||
|
CLANG_TIDY_CHECKS ?= -$(subst $(space),,*,clang-analyzer-*,-clang-analyzer-cplusplus*,modernize-*,portability-*,cppcoreguidelines-*$(addprefix $(comma),$(CLANG_TIDY_EXTRA_ARGS)))
|
||||||
|
CLANG_TIDY ?= clang-tidy -checks=$(CLANG_TIDY_CHECKS)
|
||||||
|
|
||||||
|
clean: clang-tidy-clean
|
||||||
|
clang-tidy-clean:
|
||||||
|
rm -f clang-tidy-cache*.tmp
|
||||||
|
CLANG_TIDY_CACHE_CPP = clang-tidy-cache-cpp.tmp
|
||||||
|
$(CLANG_TIDY_CACHE_CPP): $(LOCAL_CPP)
|
||||||
|
$(CLANG_TIDY) $(LOCAL_CPP) -- $(FINAL_INCLUDE) -x c++ | $(CLANG_TIDY_FILTER) | tee $@
|
||||||
|
|
||||||
|
clang-tidy-h-c-cpp:
|
||||||
|
ifneq ($(CLANG_TIDY_H_C_CPP),)
|
||||||
|
$(CLANG_TIDY) $(CLANG_TIDY_H_C_CPP) -- $(FINAL_INCLUDE)
|
||||||
|
endif
|
||||||
|
clang-tidy-h-c:
|
||||||
|
ifneq ($(CLANG_TIDY_H_C_C),)
|
||||||
|
$(CLANG_TIDY) $(CLANG_TIDY_H_C) -- $(FINAL_INCLUDE)
|
||||||
|
endif
|
||||||
|
clang-tidy-h-cpp:
|
||||||
|
ifneq ($(CLANG_TIDY_H_CPP),)
|
||||||
|
$(CLANG_TIDY) $(CLANG_TIDY_H_CPP) -- $(FINAL_INCLUDE) -x c++
|
||||||
|
endif
|
||||||
|
clang-tidy-h: clang-tidy-h-c clang-tidy-h-cpp clang-tidy-h-c-cpp
|
||||||
|
|
||||||
|
clang-tidy-c:
|
||||||
|
ifneq ($(LOCAL_C),)
|
||||||
|
$(CLANG_TIDY) $(LOCAL_C) -- $(FINAL_INCLUDE)
|
||||||
|
endif
|
||||||
|
clang-tidy-cpp: $(CLANG_TIDY_CACHE_CPP)
|
||||||
|
cat $<
|
||||||
|
clang-tidy: clang-tidy-h clang-tidy-c clang-tidy-cpp
|
||||||
|
|
||||||
|
endif # ifndef TARGETS_TOOLS_MK_INCLUDED
|
||||||
32
make/test-exe.mk
Normal file
32
make/test-exe.mk
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
# generic utility modules
|
||||||
|
# (c) 2001 jannet it services
|
||||||
|
# contact@jannet.de
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
EXE_BASENAME ?= test-$(notdir $(shell $(PWD)))
|
||||||
|
|
||||||
|
include $(JWBDIR)/make/run.mk
|
||||||
|
|
||||||
|
all: $(EXE)
|
||||||
|
install:
|
||||||
|
clean: execlean localclean profclean testclean
|
||||||
|
distclean:
|
||||||
|
run test: all.dirs $(EXE) $(EXE_BIN)
|
||||||
|
strace: $(EXE) $(EXE_BIN)
|
||||||
|
test: test.done
|
||||||
|
|
||||||
|
test.done:
|
||||||
|
if ! 2>&1 make run > test.out 2>&1; then \
|
||||||
|
$(CAT) test.out; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
testclean:
|
||||||
|
$(RM) -rf test.done test.out
|
||||||
|
|
||||||
|
ifeq ($(USE_PROJECT_LIB),true)
|
||||||
|
$(LIB_SO): $(LIB_A)
|
||||||
|
$(EXE): $(LIB_SO)
|
||||||
|
endif
|
||||||
|
all.dirs:
|
||||||
13
make/text.mk
Normal file
13
make/text.mk
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
# generic utility modules
|
||||||
|
# (c) 2001 jannet it services
|
||||||
|
# contact@jannet.de
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
include $(JWBDIR)/make/defs.mk
|
||||||
|
include $(JWBDIR)/make/rules.mk
|
||||||
|
|
||||||
|
all:
|
||||||
|
install:
|
||||||
|
distclean: textclean localclean
|
||||||
|
clean: textclean localclean
|
||||||
|
test:
|
||||||
20
make/tools.mk
Normal file
20
make/tools.mk
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
# generic utility modules
|
||||||
|
# (c) 2001 jannet it services
|
||||||
|
# contact@jannet.de
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
include $(JWBDIR)/make/defs.mk
|
||||||
|
include $(JWBDIR)/make/defs-cpp.mk
|
||||||
|
include $(JWBDIR)/make/profiler-defs.mk
|
||||||
|
include $(JWBDIR)/make/targets-tools.mk
|
||||||
|
include $(JWBDIR)/make/cpp-extra-targets.mk
|
||||||
|
include $(JWBDIR)/make/depend.mk
|
||||||
|
include $(JWBDIR)/make/backup.mk
|
||||||
|
include $(JWBDIR)/make/dev-utils.mk
|
||||||
|
|
||||||
|
FINAL_CFLAGS += -D_USRDLL -DALL_EXPORTS
|
||||||
|
FINAL_CXXFLAGS += -D_USRDLL -DALL_EXPORTS
|
||||||
|
|
||||||
|
ifneq ($(SRC_ALL_CPP),)
|
||||||
|
all: all.done
|
||||||
|
endif
|
||||||
28
make/yapp.mk
Normal file
28
make/yapp.mk
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
SRC_ALL_CPP += main.cpp
|
||||||
|
YAPP_INCLUDE_DIR ?= .
|
||||||
|
YAPP_CLASS ?= $(firstword $(basename $(notdir $(wildcard $(addprefix \
|
||||||
|
$(YAPP_INCLUDE_DIR)/, YApp*.h App*.h Y*.h *.h)))))
|
||||||
|
YAPP_CLASS_H ?= $(firstword $(wildcard $(addsuffix /$(YAPP_CLASS).h,\
|
||||||
|
$(YAPP_INCLUDE_DIR) $(subst -I,,$(FINAL_INCLUDE)))) $(YAPP_CLASS).h)
|
||||||
|
YAPP_NAMESPACE ?=
|
||||||
|
|
||||||
|
ifneq ($(TARGET),mingw)
|
||||||
|
FINAL_LDFLAGS += -rdynamic
|
||||||
|
endif
|
||||||
|
|
||||||
|
include $(JWBDIR)/make/exe.mk
|
||||||
|
|
||||||
|
all: build_EXE
|
||||||
|
install: install_EXE
|
||||||
|
clean: clean.yapp
|
||||||
|
distclean:
|
||||||
|
|
||||||
|
clean.yapp:
|
||||||
|
$(RM) -f main.cpp
|
||||||
|
|
||||||
|
main.cpp: $(YAPP_CLASS_H)
|
||||||
|
echo "#include \"$<\"" > $@.tmp
|
||||||
|
if [ "$(YAPP_NAMESPACE)" ]; then echo "using namespace $(YAPP_NAMESPACE);" >> $@.tmp; fi
|
||||||
|
echo "#include <ytools/YAppRunner.h>" >> $@.tmp
|
||||||
|
echo "yapp_main($(YAPP_CLASS))" >> $@.tmp
|
||||||
|
mv $@.tmp $@
|
||||||
41
scripts/make-version-script.sh
Normal file
41
scripts/make-version-script.sh
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
#!/bin/sh
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# generic utiltiy modules #
|
||||||
|
# (c) 2001 jannet it services #
|
||||||
|
# contact@jannet.de #
|
||||||
|
# #
|
||||||
|
# $Id$
|
||||||
|
# #
|
||||||
|
# This program is free software; permission to use, copy, modify, #
|
||||||
|
# distribute, and sell this software and its documentation under the #
|
||||||
|
# terms of the GNU Public license as published by the Free Software #
|
||||||
|
# Foundation, either version 2 or any later version of the license, is #
|
||||||
|
# hereby granted without fee, provided that (i) the above copyright #
|
||||||
|
# notices and this permission notice appear in all copies of the #
|
||||||
|
# software and related documentation, and (ii) the name of JanNet may #
|
||||||
|
# not be used in any advertising or publicity relating to the software #
|
||||||
|
# without the specific, prior written permission of JanNet. #
|
||||||
|
# #
|
||||||
|
# This program is distributed in the hope that it will be useful, but #
|
||||||
|
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- #
|
||||||
|
# TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General #
|
||||||
|
# Public License for more details. #
|
||||||
|
# #
|
||||||
|
# You should have received a copy of the GNU General Public License #
|
||||||
|
# along with this program; if not, write to the Free Software Founda- #
|
||||||
|
# tion, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
|
||||||
|
version_tag=$1
|
||||||
|
|
||||||
|
cat << EOT
|
||||||
|
VERSION {
|
||||||
|
$version_tag {
|
||||||
|
global:
|
||||||
|
*;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
EOT
|
||||||
Loading…
Add table
Add a link
Reference in a new issue