forked from chai3d/chai3d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.common
122 lines (106 loc) · 3.25 KB
/
Makefile.common
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Software License Agreement (BSD License)
# Copyright (c) 2003-2016, CHAI3D.
# (www.chai3d.org)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
#
# * Neither the name of CHAI3D nor the names of its contributors may
# be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# $Author: seb $
# $Date: 2016-01-21 16:13:27 +0100 (Thu, 21 Jan 2016) $
# $Rev: 1906 $
# config settings
include $(TOP_DIR)/Makefile.config
# determine build configuration
ifneq ($(CFG),debug)
CFG = release
endif
# target library name
LIB_NAME = chai3d
# determine platform
ARCH ?= $(shell echo `uname -m`)
SYSTEM ?= $(shell echo `uname -s`)
ifeq ($(SYSTEM), Linux)
OS = lin
endif
ifeq ($(SYSTEM), Darwin)
OS = mac
endif
# common paths
BIN_DIR = $(TOP_DIR)/bin/$(OS)-$(ARCH)
LIB_DIR = $(TOP_DIR)/lib/$(CFG)/$(OS)-$(ARCH)-$(COMPILER)
# common compiler flags
CXXFLAGS += -I$(TOP_DIR)/src -fsigned-char
# build configuration specific flags
ifneq ($(CFG),debug)
CXXFLAGS += -O3
else
CXXFLAGS += -O0 -g -DDEBUG
endif
# common librarian flags
ARFLAGS = rs
# target library
LIB_TARGET = $(LIB_DIR)/lib$(LIB_NAME).a
# common linker flags
LDFLAGS = -L$(LIB_DIR)
LDLIBS = -l$(LIB_NAME)
# optional linker flags (see Makefile.config)
ifeq ($(USE_EXTERNAL_LIBPNG), yes)
LDLIBS += -lpng -lz
endif
ifeq ($(USE_EXTERNAL_LIBJPEG), yes)
LDLIBS += -ljpeg
endif
ifeq ($(USE_EXTERNAL_GIFLIB), yes)
LDLIBS += -lgif
endif
ifeq ($(USE_EXTERNAL_LIB3DS), yes)
LDLIBS += -l3ds
endif
ifeq ($(USE_EXTERNAL_OPENAL), yes)
LDLIBS += -lopenal
endif
ifeq ($(USE_EXTERNAL_THEORAPLAYER), yes)
LDLIBS += -ltheoraplayer
endif
# Eigen dependency
EIGEN = $(TOP_DIR)/external/Eigen
CXXFLAGS += -I$(EIGEN)
# GLEW dependency
GLEW_DIR = $(TOP_DIR)/external/glew
CXXFLAGS += -I$(GLEW_DIR)/include
# DHD dependency
DHD_EXT ?= $(TOP_DIR)/external/DHD
DHD_LIB ?= $(DHD_EXT)/lib/$(OS)-$(ARCH)
CXXFLAGS += -I$(DHD_EXT)/include
LDFLAGS += -L$(DHD_LIB)
LDLIBS += -ldrd
# platform-specific macros
include $(TOP_DIR)/Makefile.common.$(OS)