3 include $(TOP
)/Make.conf
5 # A sample Makefile for building Google Test and using it in user
6 # tests. Please tweak it to suit your environment and project. You
7 # may want to move it to your project's root directory.
11 # make [all] - makes everything.
12 # make TARGET - makes the given target.
13 # make clean - removes all files generated by make.
15 # Please tweak the following variable definitions as needed by your
16 # project, except GTEST_HEADERS, which you can use in your own targets
17 # but shouldn't modify.
19 # Points to the root of Google Test, relative to where this file is.
20 # Remember to tweak this if you move this file.
21 GTEST_DIR
= ..
/..
/lib
/gtest-1.6
.0
23 # Where to find user code.
26 # Flags passed to the preprocessor.
27 CPPFLAGS
+= -I
$(GTEST_DIR
)/include
29 # Flags passed to the C++ compiler.
30 CXXFLAGS
+= -g
-Wall
-Wextra
32 CFLAGS
= $(CXXFLAGS
) -I
$(TOP
)/include -I. \
33 $(T1_INC
) $(EXPAT_INC
) $(GSL_CFLAGS
) $(CUPS_CFLAGS
) \
34 $(CPPFLAGS
) $(XBAE_INC
) $(GUI_FLAGS
)
37 $(GRACE_LIB
) $(EXPAT_LIB
) $(GRACE_PLOT_LIB
) $(GRACE_GRAAL_LIB
) \
38 $(GRACE_CORE_LIB
) $(GRACE_CANVAS_LIB
) $(T1_LIB
) $(XMI_LIB
) \
39 $(PDF_LIB
) $(HARU_LIB
) $(JPEG_LIB
) $(PNG_LIB
) $(Z_LIB
) \
40 $(GRACE_BASE_LIB
) $(UNDO_LIB
) \
41 $(GSL_LIBS
) $(NETCDF_LIBS
) $(FFTW_LIB
) $(CUPS_LIBS
) \
42 $(WINDOWS_LIBS
) $(NOGUI_LIBS
) $(DL_LIB
)
44 # All tests produced by this Makefile. Remember to add new tests you
45 # created to the list.
46 TESTS
= check_grace
$(EXE
)
48 # All Google Test headers. Usually you shouldn't change this
50 GTEST_HEADERS
= $(GTEST_DIR
)/include/gtest
/*.h \
51 $(GTEST_DIR
)/include/gtest
/internal
/*.h
53 # House-keeping build targets.
60 rm -f
$(TESTS
) gtest.a gtest_main.a
*.o
62 # Builds gtest.a and gtest_main.a.
64 # Usually you shouldn't tweak such internal variables, indicated by a
66 GTEST_SRCS_
= $(GTEST_DIR
)/src
/*.
cc $(GTEST_DIR
)/src
/*.h
$(GTEST_HEADERS
)
68 # For simplicity and to avoid depending on Google Test's
69 # implementation details, the dependencies specified below are
70 # conservative and not optimized. This is fine as Google Test
71 # compiles fast and for ordinary users its source rarely changes.
72 gtest-all.o
: $(GTEST_SRCS_
)
73 $(CXX
) $(CPPFLAGS
) -I
$(GTEST_DIR
) $(CXXFLAGS
) -c \
74 $(GTEST_DIR
)/src
/gtest-all.
cc
76 gtest_main.o
: $(GTEST_SRCS_
)
77 $(CXX
) $(CPPFLAGS
) -I
$(GTEST_DIR
) $(CXXFLAGS
) -c \
78 $(GTEST_DIR
)/src
/gtest_main.
cc
81 $(AR
) $(ARFLAGS
) $@
$^
83 gtest_main.a
: gtest-all.o gtest_main.o
84 $(AR
) $(ARFLAGS
) $@
$^
86 # Builds a sample test. A test should link with either gtest.a or
87 # gtest_main.a, depending on whether it defines its own main()
90 #sample1.o : $(USER_DIR)/sample1.cc $(USER_DIR)/sample1.h $(GTEST_HEADERS)
91 # $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/sample1.cc
93 #include ../src/Make.common
95 check_grace.o
: $(USER_DIR
)/check_grace.
cpp $(GTEST_HEADERS
)
96 $(CXX
) $(CFLAGS
) $(CPPFLAGS
) $(CXXFLAGS
) -c
$(USER_DIR
)/check_grace.
cpp
98 check_grace
$(EXE
) : check_grace.o gtest_main.a \
99 $(GRACE_LIB
) $(GRACE_PLOT_LIB
) $(GRACE_CORE_LIB
) \
100 $(GRACE_GRAAL_LIB
) $(GRACE_CANVAS_LIB
) $(GRACE_BASE_LIB
)
101 $(CXX
) $(CFLAGS
) $^
$(GRACE_QTGUI_LIB
) -o
$@
$(LDFLAGS
) $(LIBS
) -lpthread
104 check_lib.o
: $(USER_DIR
)/check_lib.
cpp $(GTEST_HEADERS
)
105 $(CXX
) $(CFLAGS
) $(CPPFLAGS
) $(CXXFLAGS
) -c
$(USER_DIR
)/check_lib.
cpp
107 check_lib
$(EXE
) : check_lib.o gtest_main.a
108 $(CXX
) $(CFLAGS
) -lpthread
$^
-o
$@
$(LDFLAGS
) $(LIBS
)