From 5abe4bd15642bbc83f46553aa5275430b14f5f91 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Tue, 10 May 2005 14:55:18 +0000 Subject: *** empty log message *** --- zinclib.d/Makefile | 173 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 zinclib.d/Makefile (limited to 'zinclib.d/Makefile') diff --git a/zinclib.d/Makefile b/zinclib.d/Makefile new file mode 100644 index 0000000..3a9d9d9 --- /dev/null +++ b/zinclib.d/Makefile @@ -0,0 +1,173 @@ +######################################## +# Makefile for zinclib # +######################################## + +# default +all: zinclib + + + + + +###################################################################### +# IntuiKit common Makefile # +# # +# This software is the property of IntuiLab SA, France. # +# # +# Contributors: # +# Benoit Peccatte # +# # +###################################################################### + +## remove when no more in development +DEBUG :=1 + +################################## +# Default GNU compilation options +################################## +CXX := g++ +GCC := g++ +LIBEXT := .so +EXE := +DELFILES := + +PROFILE = +MACRO = +LIBDIR = ./lib +INCLUDE = -isystem ./include +LDFLAGS = $(PROFILE) -L$(LIBDIR) +CXXFLAGS = -Wall -fpermissive $(MACRO) $(PROFILE) $(INCLUDE) +INCLUDES = -fno-rtti +LIBLDFLAGS = -shared $(LDFLAGS) -Wl,-export-dynamic +LIBCXXFLAGS = -fPIC $(CXXFLAGS) + + +################################### +# Automatic architecture detection +################################### +ifndef ARCH +ARCH := $(shell uname -s) +endif + +# linux +ifeq ($(ARCH),Linux) +LIBEXT := .so +MACRO += -DLINUX +LDFLAGS += -ldl +endif + +# MacOSX +ifeq ($(ARCH),Darwin) +LIBEXT := .dylib +MACRO += -DMACOSX_BSD +LDFLAGS += -ldl +LIBLDFLAGS = -Wl,-single_module -dynamiclib $(LDFLAGS) +endif + +# Windows cross compile +ifeq ($(ARCH),win32) +CXX := i386-mingw32msvc-g++ +GCC := i386-mingw32msvc-gcc +LIBEXT := .dll +EXE := .exe +MACRO += -DWIN32 +LDFLAGS += -L$(EXPAT_HOME) +endif + +# native windows 2K, XP +ifeq ($(ARCH),MINGW32_NT-5.1) +LIBEXT := .dll +EXE := .exe +MACRO += -DWIN32 +endif + + + +################### +# Options handling +################### + +##### DEBUG options +ifdef DEBUG +CXXFLAGS += -g +endif + +##### Profiling options +ifdef PROF +PROFILE = -pg -fprofile-arcs -ftest-coverage +DELFILES += *.gcov *.bb *.bbg *.da gmon.out +endif + +##### Purify coverage options +ifdef COV +GCC := purecov $(GCC) +DELFILES += *.pcv +endif + +##### Purify options +ifdef PURIFY +GCC := purify -view-file=pure.pv $(GCC) +DELFILES += .pure* *_pure_* pure.pv +endif + +##### Options to display more warnings +ifdef VERBOSE +CXXFLAGS += -Wctor-dtor-privacy -Wnon-virtual-dtor +CXXFLAGS += -Wold-style-cast -Woverloaded-virtual +CXXFLAGS += -Wsign-promo -Wsynth -Wsynth -pedantic -Wchar-subscripts +CXXFLAGS += -Wcomment -Wimplicit -Wmissing-braces -Wparentheses +CXXFLAGS += -Wreturn-type -Wswitch -Wtrigraphs -Wunused +CXXFLAGS += -Wreorder -Wunknown-pragmas -W -Wsign-compare +CXXFLAGS += -Wfloat-equal -Wundef -Wlarger-than-1000 +CXXFLAGS += -Wpointer-arith -Wcast-qual -Wcast-align +CXXFLAGS += -Wstrict-prototypes -Wmissing-prototypes +CXXFLAGS += -Wmissing-noreturn -Wmissing-format-attribute -Wpacked +CXXFLAGS += -Wredundant-decls -Wunreachable-code -Winline +CXXFLAGS += -Wdisabled-optimization -Wconversion -Wshadow +CXXFLAGS += -O0 +ifeq ($(VERBOSE),2) +CXXFLAGS += -Wpadded -Wabi -Weffc++ -Waggregate-return -Wwrite-strings +endif +endif + +##### Optimization options +ifdef OPTIMIZE +CXXFLAGS += -O$(OPTIMIZE) -Wuninitialized +endif + +######################################################### +# END OF IntuiKit Common # +######################################################### + +# specific options +LDFLAGS += -ltcl8.4 -ltk8.4 -lTkZinc + +# easy target +zinclib: tmp/zinclib.o + +tmp/zinclib.o: tmp/ZincObjects.o tmp/ZincPath.o tmp/Zinc.o + ld -r -o $@ $^ + +# generic target +tmp/%.o: src/%.cpp + @mkdir -p tmp + $(CXX) $(LIBCXXFLAGS) -o $@ -c $< + +clean: + rm -f tmp/*.o $(PROFFILES) + +# documentation +doc: + cd src; doxygen ../doxyConfig + mkdir -p doc + rm -rf doc/html + mv src/docs/* doc + rmdir src/docs + +# tests +test: + cd test; $(MAKE) + cd test; ./runtests.sh + +.PHONY: test doc + -- cgit v1.1