[go: up one dir, main page]

Menu

[r710]: / tags / 0.1.0 / Makefile  Maximize  Restore  History

Download this file

102 lines (85 with data), 3.9 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
# =============================================================================
# Basic template makefile for libraries.
# $Id$
#
# *** IMPORTANT NOTES -- READ THESE FIRST ***
# 1) This file _requires_ the use of GNU make (gmake).
# =============================================================================
DZR_BASE_DIR= .
# Nothing but comments should come before this line.
default: all
OBJDIR=objs.$(HOSTTYPE).$(CXX)
DEPDIR=deps.$(HOSTTYPE).$(CXX)
LIBDIR=libs.$(HOSTTYPE).$(CXX)
# -----------------------------------------------------------------------------
# Application-specific variable settings. It is safe to modify these.
# -----------------------------------------------------------------------------
# The base name of the library that is built. A value must be set for this!
# The platform-specific extensions for shared libraries and static libraries
# are appended below.
LIB_NAME= cppdom
# The directory where the source files for this library are located.
srcdir= cppdom
# Compiler flags needed for this library. They are used as follows:
#
# DEBUG_APP - If set to TRUE, this librar will be compiled with
# debugging symbols and no optimized symbols
# OPTIM_APP - If set to TRUE, this librar will be compiled with
# optimized symbols and no debugging symbols
# EXTRA_INCLUDES - Extra include paths (-I... options) for the compilers
#
DEBUG_APP= TRUE
OPTIM_APP= FALSE
EXTRA_INCLUDES= -I.
# The list of all source files needed for this librar. Based on this, a list
# of object files is put in $(OBJS) automatically.
SRCS= cppdom.cpp xmlparser.cpp xmltokenizer.cpp version.cpp
# Extend this as necessary to find source files that are not in the current
# directory. Set EXTRA_PATH_FOR_SOURCES to all the directories that you
# have sources in. (current dir is already included by default)
EXTRA_PATH_FOR_SOURCES= cppdom
# Additional files and directories besides the standard ones that need to be
# removed by the 'clean' target.
CLEAN_FILES=
CLEAN_DIRS=
# The following include line MUST COME BEFORE the targets for compiling the
# library.
#
# To build a library, include the following basic file:
#
# dzr.lib.mk - An ordinary software library
#
include $(DZR_BASE_DIR)/mk/dzr.lib.mk
# -----------------------------------------------------------------------------
# Targets.
# -----------------------------------------------------------------------------
SHARED_LIB_FILENAME=$(LIBDIR)/$(SHLIB_PREFIX)$(LIB_NAME)$(SHLIB_EXT)
STATIC_LIB_FILENAME=$(LIBDIR)/$(LIB_PREFIX)$(LIB_NAME)$(LIB_EXT)
all: $(SHARED_LIB_FILENAME) $(STATIC_LIB_FILENAME)
tests:
-cd test && ${MAKE}
MAKE_THE_LIBDIR= @if [ ! -d $(LIBDIR) ]; then mkdir $(LIBDIR) ; fi
# Target for the shared library to be built.
$(SHARED_LIB_FILENAME): $(OBJS)
-$(MAKE_THE_LIBDIR)
$(SHARED_LINK) $(SHARED_OUT)$@ $(OBJS)
# Target for the static library to be built.
$(STATIC_LIB_FILENAME): $(OBJS)
-$(MAKE_THE_LIBDIR)
$(STATIC_LINK) $(STATIC_OUT)$@ $(OBJS)
# TODO: edit this to install your files...
# - determine if you need all the dirs (bin, share, lib, include)
# - append cp or install commands for your .h, lib files...
# - prefix is your install path, edit it to specify the default
prefix ?= installed.$(HOSTTYPE).$(CXX)
INSTALLCMD=./install-sh
install: all tests
-$(INSTALLCMD) -d $(prefix)/include
-$(INSTALLCMD) -d $(prefix)/include/$(LIB_NAME)
-$(INSTALLCMD) -d $(prefix)/lib$(LIBBITSUF)
-$(INSTALLCMD) -d $(prefix)/share/$(LIB_NAME)
-$(INSTALLCMD) -d $(prefix)/bin
-cp $(LIB_NAME)/*.h $(prefix)/include/$(LIB_NAME)
-cp $(SHARED_LIB_FILENAME) $(STATIC_LIB_FILENAME) $(prefix)/lib$(LIBBITSUF)
-cp test/predtest test/nodetest test/parsetest test/*.xml $(prefix)/share/$(LIB_NAME)
CLOBBER_FILES += $(SHARED_LIB_FILENAME) $(STATIC_LIB_FILENAME)