-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile(Linux).gcc
More file actions
86 lines (79 loc) · 2.55 KB
/
makefile(Linux).gcc
File metadata and controls
86 lines (79 loc) · 2.55 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
# Example Makefile for C++ Programming with wxWidgets on Linux
#
# The PROGRAM macro defines the name of the program or project. It
# allows the program name to be changed by editing in only one
# location
#
PROGRAM = SimFlu
#
# The INCLUDEDIRS macro contains a list of include directories
# to pass to the compiler so it can find necessary header files.
#
# The LIBDIRS macro contains a list of library directories
# to pass to the linker so it can find necessary libraries.
#
# The LIBS macro contains a list of libraries that the the
# executable must be linked against.
#
#定义编译需要用的头文件和库等
INCLUDEDIRS = $(shell wx-config --cxxflags)
LIBS = $(shell wx-config --libs)
#
# The CXXSOURCES macro contains a list of source files.
#
# The CXXOBJECTS macro converts the CXXSOURCES macro into a list
# of object files.
#
# The CXXFLAGS macro contains a list of options to be passed to
# the compiler. Adding "-g" to this line will cause the compiler
# to add debugging information to the executable.
#
# The CXX macro defines the C++ compiler.
#
# The LDFLAGS macro contains all of the library and library
# directory information to be passed to the linker.
#
VPATH = ./src
CXXSOURCES = SimFluUIApp.cpp SimFluUIMain.cpp SimFluUIThread.cpp \
simulator.cpp randgen.cpp population.cpp params.cpp
CXXOBJECTS = $(CXXSOURCES:.cpp=.o)
CXXFLAGS = $(INCLUDEDIRS) -std=c++11 -g
CXX = g++
LDFLAGS = $(LIBS)
#
# Default target: the first target is the default target.
# Just type "make -f Makefile.LinuxWx" to build it.
#
all: $(PROGRAM)
#
# Link target: automatically builds its object dependencies before
# executing its link command.
#
$(PROGRAM): $(CXXOBJECTS)
$(CXX) -o $@ $(CXXOBJECTS) $(CXXFLAGS) $(LDFLAGS)
#
# Object targets: rules that define objects, their dependencies, and
# a list of commands for compilation.
#
SimFluUIApp.o:SimFluUIApp.cpp SimFluUIApp.h wx_pch.h
$(CXX) $(CXXFLAGS) -c $<
SimFluUIMain.o:SimFluUIMain.cpp SimFluUIMain.h SimFluUIThread.h simulator.h params.h wx_pch.h
$(CXX) $(CXXFLAGS) -c $<
SimFluUIThread.o:SimFluUIThread.cpp SimFluUIThread.h simulator.h params.h
$(CXX) $(CXXFLAGS) -c $<
simulator.o:simulator.cpp simulator.h
$(CXX) $(CXXFLAGS) -c $<
randgen.o:randgen.cpp randgen.h
$(CXX) $(CXXFLAGS) -c $<
population.o:population.cpp population.h
$(CXX) $(CXXFLAGS) -c $<
params.o:params.cpp params.h
$(CXX) $(CXXFLAGS) -c $<
#
# Clean target: "make -f Makefile.LinuxWx clean" to remove unwanted objects and executables.
#
clean:
rm $(PROGRAM) $(CXXOBJECTS)
#
# Run target: "make -f Makefile.LinuxWx run" to execute the application
#