mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
defs.mk: Improve centralized plugin compilation management
- Shift effects of conditional compilation with USE_ from proj.mk of the
respective project directories into defs.mk here. Might still be present in some project
directories but shouldn't
- Add support for $(IGNORE_SUBDIRS) in $(FIND_SUBDIRS)
- Add support for $(IS_PLUGIN) (not installing header files in this case)
- Add some g++ paths to $(DEPEND_CPPFLAGS) to calm makedepend's
complaining about missing headerfiles a bit down is
compiler-dependent, though
This commit is contained in:
parent
a0e2104011
commit
a22004b1ca
1 changed files with 56 additions and 23 deletions
79
make/defs.mk
79
make/defs.mk
|
|
@ -19,7 +19,7 @@ CVS_ROOT_DIR = $(shell test -d CVS && pwd | sed -e "s%`cat CVS/Reposit
|
|||
REV_SUBDIRS = $(shell echo $(SUBDIRS) | awk '{for (i=NF; i>=1; i--) printf ("%s ",$$i)}')
|
||||
FRESH_CVSDIR = $(HOME)/local/src/cvs.fresh
|
||||
|
||||
FIND_SUBDIRS = $(filter-out . .. ./CVS, $(shell find . -type d -maxdepth 1))
|
||||
FIND_SUBDIRS = $(filter-out . .. ./CVS $(addprefix ./,$(IGNORE_SUBDIRS)), $(shell find . -type d -maxdepth 1))
|
||||
|
||||
PROJECT_CAPNAME = $(shell echo $(PROJECT) | tr [a-z] [A-Z])
|
||||
|
||||
|
|
@ -57,7 +57,9 @@ SRC_HEADERED += $(shell if [ "$(LOCAL_SRC)" ]; then grep -ic "it servic
|
|||
SRC_UNHEADERED += $(filter-out $(SRC_HEADERED),$(LOCAL_SRC))
|
||||
LOCAL_C += $(wildcard *.c)
|
||||
LOCAL_CPP += $(wildcard *.cc *.cpp *.C)
|
||||
ifeq ($(IS_PLUGIN),)
|
||||
LOCAL_H += $(wildcard *.h *.H)
|
||||
endif
|
||||
SFILES += $(wildcard *.S)
|
||||
UIFILES += $(wildcard *.ui)
|
||||
RCCFILES += $(wildcard *.qrc)
|
||||
|
|
@ -239,7 +241,8 @@ CPPFLAGS += -I/usr/local/include
|
|||
DEPEND_CPPFLAGS += -I/usr/include/g++ -I/usr/local/include
|
||||
else
|
||||
LPPFLAGS += -L/usr/local/gcc3.3/lib -lstdc++ -lgcc_s
|
||||
DEPEND_CPPFLAGS += -I/usr/local/gcc3.3/include/c++/3.3 -I/usr/local/gcc3.3/include/c++/3.3/i686-pc-linux-gnu -I/usr/local/include
|
||||
DEPEND_CPPFLAGS += -I/usr/local/gcc3.3/include/c++/3.3 -I/usr/local/gcc3.3/include/c++/3.3/i686-pc-linux-gnu -I/usr/local/include \
|
||||
-I/usr/include/g++/ext -I/usr/include/g++ -I/usr/include/g++/i586-suse-linux
|
||||
endif
|
||||
|
||||
ifeq ($(LIBTYPE),shared)
|
||||
|
|
@ -328,34 +331,64 @@ ifeq ($(USE_TRACING),true)
|
|||
PROJECT_CPPFLAGS += -D_DO_TRACE_
|
||||
endif
|
||||
|
||||
ifeq ($(USE_COMPILER_DEBUG_OPTS),true)
|
||||
|
||||
CFLAGS_DEBUG += -Wall -D_DEBUG_ -g3 $(MEMWATCH)
|
||||
CPPFLAGS_DEBUG += $(CFLAGS_DEBUG)
|
||||
LDFLAGS_DEBUG +=
|
||||
|
||||
PROJECT_CFLAGS += $(CFLAGS_DEBUG)
|
||||
PROJECT_CPPFLAGS += $(CFLAGS_DEBUG)
|
||||
PROJECT_LDFLAGS += $(LDFLAGS_DEBUG)
|
||||
else
|
||||
PROJECT_CFLAGS += -DNDEBUG
|
||||
PROJECT_CPPFLAGS += -DNDEBUG
|
||||
endif
|
||||
|
||||
ifeq ($(USE_COMPILER_OPTIMIZATION_OPTS),true)
|
||||
PROJECT_CFLAGS += -funroll-loops -O3
|
||||
PROJECT_CPPFLAGS += -funroll-loops -O3
|
||||
endif
|
||||
|
||||
ifeq ($(USE_STACK_PROTECTOR),true)
|
||||
PROJECT_CFLAGS += -fstack-protector-all
|
||||
# PROJECT_CFLAGS += -fstack-protector
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EFENCE),true)
|
||||
LDFLAGS += -lefence
|
||||
ifeq ($(USE_DBMALLOC),true)
|
||||
CONTRIB_LIBS += dbmalloc
|
||||
PROJECT_CFLAGS += -DDBMALLOC -DEXITFUN=_exit -I$(TOPDIR)/contrib/dbmalloc
|
||||
PROJECT_CPPFLAGS += -DDBMALLOC -DEXITFUN=_exit -I$(TOPDIR)/contrib/dbmalloc
|
||||
PROJECT_LDFLAGS += -ldbmalloc
|
||||
endif
|
||||
|
||||
ifeq ($(USE_DMALLOC),true)
|
||||
PROJECT_CFLAGS += -DDMALLOC -DDMALLOC_FUNC_CHECK -DSTORE_SEEN_COUNT
|
||||
PROJECT_CPPFLAGS += -DDMALLOC -DDMALLOC_FUNC_CHECK -DSTORE_SEEN_COUNT
|
||||
PROJECT_LDFLAGS += -ldmallocthcxx -ldmallocth
|
||||
endif
|
||||
|
||||
ifeq ($(USE_MEMWATCH),true)
|
||||
PROJECT_CFLAGS += -DMEMWATCH -DMW_STDIO
|
||||
PROJECT_CPPFLAGS += -DMEMWATCH -DMW_STDIO
|
||||
endif
|
||||
|
||||
ifeq ($(USE_EFENCE),true)
|
||||
PROJECT_CFLAGS += -DEFENCE
|
||||
PROJECT_CPPFLAGS += -DEFENCE
|
||||
PROJECT_LDFLAGS += -lefence
|
||||
endif
|
||||
|
||||
ifeq ($(USE_TRACING),true)
|
||||
PROJECT_CFLAGS += -D_DO_TRACE_
|
||||
PROJECT_CPPFLAGS += -D_DO_TRACE_
|
||||
endif
|
||||
|
||||
ifeq ($(COMPILE_DEBUG_CODE),true)
|
||||
PROJECT_CFLAGS += -D_DEBUG_
|
||||
PROJECT_CPPFLAGS += -D_DEBUG_
|
||||
endif
|
||||
|
||||
ifeq ($(USE_MPATROL),true)
|
||||
PROJECT_CFLAGS += -include $(MODDIR)/include/mpatrol.h
|
||||
# PROJECT_CPPFLAGS += -include $(MODDIR)/include/mpatrol.h
|
||||
PROJECT_LDFLAGS += -lmpatrolmt -lbfd -liberty
|
||||
endif
|
||||
|
||||
ifeq ($(USE_COMPILER_DEBUG_OPTS),true)
|
||||
PROJECT_CFLAGS += -Wall -g3
|
||||
PROJECT_CPPFLAGS += -Wall -g3
|
||||
PROJECT_LDFLAGS += -Wall -g3
|
||||
else
|
||||
ifeq ($(USE_COMPILER_OPTIMIZATION_OPTS),true)
|
||||
PROJECT_CFLAGS += -funroll-loops -O2
|
||||
endif
|
||||
endif
|
||||
|
||||
#export PROJECT PROJECT_CFLAGS PROJECT_CPPFLAGS PROJECT_LDFLAGS USE_TIMER
|
||||
|
||||
|
||||
ifneq ($(wildcard $(TOPDIR)/make/local.mk),)
|
||||
include $(TOPDIR)/make/local.mk
|
||||
endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue