-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmakefile
More file actions
147 lines (106 loc) · 3.5 KB
/
makefile
File metadata and controls
147 lines (106 loc) · 3.5 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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
###############################################################
# #
# Lady Heather MAKEFILE for Linux, FreeBSD, or #
# OS/X (with XQuartz X11 library) #
# #
# #
###############################################################
# Run make with USE_SDL=1 set to build with SDL support
# instead of X11 for Mac and Linux:
# bash$ USE_SDL=1 make
OS := $(shell uname -s)
CC = g++
ifeq ($(USE_SDL),1)
SDL_OBJS=SDL_gfxPrimitives.o heather_sdl.o
SDL_INC=-I$(shell sdl2-config --prefix)/include -DUSE_SDL=1
SDL_LIBS=$(shell sdl2-config --static-libs)
else
SDL_OBJS=
SDL_INC=
SDL_LIBS=
endif
#
# Linux build
#
ifeq ($(OS),Linux)
# WARNS = -Wno-write-strings
WARNS = -Wno-write-strings -Wall -Wno-unused-but-set-variable -Wno-unused-variable -Wno-format-overflow
ifeq ($(USE_SDL),1)
CPPFLAGS=$(SDL_INC)
LDFLAGS=-$(SDL_LIBS)
else
CPPFLAGS=-I/opt/X11/include
LDFLAGS=-L/usr/X11/lib -lm -lX11
endif
all: heather
heather.o: heather.cpp heather.ch heathfnt.ch makefile
$(CC) -c heather.cpp $(WARNS) $(CPPFLAGS)
heathmsc.o: heathmsc.cpp heather.ch heathfnt.ch makefile
$(CC) -c heathmsc.cpp $(WARNS) $(CPPFLAGS)
heathui.o: heathui.cpp heather.ch heathfnt.ch makefile
$(CC) -c heathui.cpp $(WARNS) $(CPPFLAGS)
heathgps.o: heathgps.cpp heather.ch heathfnt.ch makefile
$(CC) -c heathgps.cpp $(WARNS) $(CPPFLAGS)
heather: heather.o heathmsc.o heathui.o heathgps.o $(SDL_OBJS)
$(CC) heather.o heathui.o heathgps.o heathmsc.o $(SDL_OBJS) -o heather $(LDFLAGS)
SDL_gfxPrimitives.o: SDL_gfxPrimitives.cpp SDL_gfxPrimitives.h makefile
$(CC) -c SDL_gfxPrimitives.cpp $(WARNS) $(CPPFLAGS)
heather_sdl.o: heather_sdl.cpp heather.ch makefile
$(CC) -c heather_sdl.cpp $(WARNS) $(CPPFLAGS)
clean:
rm heather.o heathui.o heathgps.o heathmsc.o $(SDL_OBJS) heather
endif
#
# OS/X build
#
ifeq ($(OS),Darwin)
# WARNS = -Wno-write-strings
WARNS = -Wno-write-strings -Wall -Wno-unused-variable -Wno-unused-but-set-variable -Wno-deprecated-declarations
ifeq ($(USE_SDL),1)
CPPFLAGS=$(SDL_INC)
LDFLAGS=$(SDL_LIBS)
else
CPPFLAGS=-I/opt/X11/include
LDFLAGS=-L/usr/X11/lib -lm -lX11
endif
all: heather
heather.o: heather.cpp heather.ch heathfnt.ch makefile
$(CC) -c heather.cpp $(WARNS) $(CPPFLAGS)
heathmsc.o: heathmsc.cpp heather.ch heathfnt.ch makefile
$(CC) -c heathmsc.cpp $(WARNS) $(CPPFLAGS)
heathui.o: heathui.cpp heather.ch heathfnt.ch makefile
$(CC) -c heathui.cpp $(WARNS) $(CPPFLAGS)
heathgps.o: heathgps.cpp heather.ch heathfnt.ch makefile
$(CC) -c heathgps.cpp $(WARNS) $(CPPFLAGS)
heather: heather.o heathmsc.o heathui.o heathgps.o $(SDL_OBJS)
$(CC) heather.o heathui.o heathgps.o heathmsc.o $(SDL_OBJS) -o heather $(LDFLAGS)
SDL_gfxPrimitives.o: SDL_gfxPrimitives.cpp SDL_gfxPrimitives.h makefile
$(CC) -c SDL_gfxPrimitives.cpp $(WARNS) $(CPPFLAGS)
heather_sdl.o: heather_sdl.cpp heather.ch makefile
$(CC) -c heather_sdl.cpp $(WARNS) $(CPPFLAGS)
clean:
rm heather.o heathui.o heathgps.o heathmsc.o $(SDL_OBJS) heather
endif
#
# FreeBSD build
#
ifeq ($(OS),FreeBSD)
CC = cc
WARNS = -Wall -Wno-c++11-compat-deprecated-writable-strings
INCLUDES = -I /usr/local/include
LIBS = -L/usr/local/lib -lm -lX11
.SUFFIXES:
.SUFFIXES: .cpp .o
.cpp.o:
$(CC) $(WARNS) $(INCLUDES) -c $< -o $@.new
mv $@.new $@
SRCS = heather.cpp heathmsc.cpp heathui.cpp heathgps.cpp
OBJS = $(SRCS:cpp=o)
all: heather
heather: $(OBJS)
$(CC) -o $@.new $(OBJS) $(LIBS)
mv $@.new $@
$(OBJS): heather.ch heathfnt.ch makefile
clean:
rm -f heather heather.new $(OBJS) $(OBJS:=.new)
endif