forked from radarsat1/chai3d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (49 loc) · 1.38 KB
/
Makefile
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
# (C) 2002-2009 - CHAI 3D
# All Rights Reserved.
#
# $Author: seb $
# $Date: 2009-06-22 12:21:41 +1200 (Mon, 22 Jun 2009) $
# $Rev: 285 $
# global path
TOP_DIR = .
# commong settings
include Makefile.common
# directories
OBJ_ROOT = $(TOP_DIR)/obj
OBJ_DIR = $(TOP_DIR)/obj/$(CFG)/$(OS)-$(ARCH)
SRC_DIR = $(TOP_DIR)/src
# include paths
CXXFLAGS += -I$(SRC_DIR) -I$(DHD_EXT)/include
# main sources
SOURCES = $(shell find $(SRC_DIR) -name '*.cpp')
# module sources
SOURCES += $(wildcard $(GEL_DIR)/*.cpp)
SOURCES += $(wildcard $(ODE_DIR)/*.cpp)
# include dependencies
INCLUDES = $(shell find $(SRC_DIR) -name '*.h')
# module includes
INCLUDES += $(wildcard $(GEL_DIR)/*.h)
INCLUDES += $(wildcard $(ODE_DIR)/*.h)
# objects
OBJECTS = $(patsubst %.cpp, $(OBJ_DIR)/%.o, $(notdir $(SOURCES)))
# build examples
SUBDIRS = examples
# build rules
all: $(LIB_TARGET) $(SUBDIRS)
$(LIB_TARGET): $(OBJ_DIR) $(LIB_DIR) $(LIB_TARGET)($(OBJECTS))
$(OBJECTS): $(INCLUDES)
$(LIB_DIR) $(OBJ_DIR):
mkdir -p $@
$(OBJ_DIR)/%.o : $(SRC_DIR)/*/%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(OBJ_DIR)/%.o : $(GEL_DIR)/%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(OBJ_DIR)/%.o : $(ODE_DIR)/%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
.PHONY: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@
clean:
@for T in $(SUBDIRS); do make -C $$T $@; done
-rm -f $(OBJECTS) $(LIB_TARGET) *~ TAGS core *.bak #*#
-rmdir $(LIB_DIR) $(OBJ_DIR)