-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.txt
99 lines (72 loc) · 2.98 KB
/
Makefile.txt
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
##############################################################################
#
# Sample Makefile for C/C++ applications for the UTSC environment.
# Works for single and multiple file programs.
#
##############################################################################
# Define C compiler
CC = gcc
# Define C++ compiler
CCC = g++
# Define C compiler options
CFLAGS = -Wall -c -g
# Define C++ compiler options
CCCFLAGS = -Wall -ansi -c -g
# Define C/C++ pre-processor options
CPPFLAGS = -I./ -I$(GLUIDIR)/include -I$(GLDIR)/include -I$(XLIBDIR)
# Define location of GLUT directory (/usr/local for UTSC)
GLUTDIR = /usr
# Define location of OpenGL directory (/usr/local for UTSC)
GLDIR = /usr
# Note the GLUI directory is in the same as the GL and GLUT directories,
# not in the X11R6 directory anymore
# Define location of GLUI directory
GLUIDIR = /usr
# And also note the different library names for the glu, gl, and glut libraries
# Define location of OpenGL and GLU libraries along with their lib names
GL_LIBS = -L/lib -lglu32 -lopengl32
# Define location of Glut libraries along with glut lib name
GLUT_LIBS = -L/lib -lglut32
# Define location of GLUI libraries along with glui lib name
GLUI_LIBS = -L/lib -lglui
# Define location of the X11 Windows directory (for X11 Windows header files)
XLIBDIR = /usr/include
# Define location of X Windows libraries, and the X11 library names
XLIBS = -L/usr/X11R6/lib -lX11 -lXi -lXmu
# Define the location of the destination directory for the executable file
DEST = ./binCYGWIN/Release
# Define flags that should be passed to the linker
LDFLAGS =
# Define libraries to be linked with
LIBS = $(GLUI_LIBS) $(GL_LIBS) $(GLUT_LIBS) -lm $(XLIBS) -ldl
# Define linker
LINKER = g++
# Define all object files to be the same as CPPSRCS but with all the .cpp and .c suffixes replaced with .o
OBJ = $(CPPSRCS:.cpp=.o) $(CSRCS:.c=.o)
# Define name of target executable
PROGRAM = Lesson01.exe
# Define all C source files here
CSRCS =
# Define all C++ source files here
CPPSRCS = Lesson01.c
##############################################################################
# Define additional rules that make should know about in order to compile our
# files.
##############################################################################
# Define default rule if Make is run without arguments
all : $(PROGRAM)
# Define rule for compiling all C++ files
%.o : %.cpp
$(CCC) $(CCCFLAGS) $(CPPFLAGS) $*.cpp
# Define rule for compiling all C files
%.o : %.c
$(CC) $(CFLAGS) $(CPPFLAGS) $*.c
# Define rule for creating executable
$(PROGRAM) : $(OBJ)
@echo -n "Loading $(PROGRAM) ... "
$(LINKER) $(LDFLAGS) $(OBJ) $(LIBS) -o $(PROGRAM)
@echo "done"
# Define rule to clean up directory by removing all object, temp and core
# files along with the executable
clean :
@rm -f $(OBJ) *~ core $(PROGRAM)