-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
112 lines (76 loc) · 2.58 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
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
###############################################################
# #
# Lady Heather MAKEFILE for Linux, FreeBSD, or #
# OS/X (with XQuartz X11 library) #
# #
# #
###############################################################
OS := $(shell uname -s)
CC = g++
#
# 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
DEFINES=
ifneq (,$(wildcard /usr/include/sys/timepps.h))
DEFINES+=-DUSE_PPS
endif
all: heather
heather.o: heather.cpp heather.ch heathfnt.ch makefile
$(CC) -c heather.cpp $(WARNS) $(DEFINES)
heathmsc.o: heathmsc.cpp heather.ch heathfnt.ch makefile
$(CC) -c heathmsc.cpp $(WARNS) $(DEFINES)
heathui.o: heathui.cpp heather.ch heathfnt.ch makefile
$(CC) -c heathui.cpp $(WARNS) $(DEFINES)
heathgps.o: heathgps.cpp heather.ch heathfnt.ch makefile
$(CC) -c heathgps.cpp $(WARNS) $(DEFINES)
heather: heather.o heathmsc.o heathui.o heathgps.o
$(CC) heather.o heathui.o heathgps.o heathmsc.o -o heather -lm -lX11
clean:
rm heather.o heathui.o heathgps.o heathmsc.o heather
endif
#
# OS/X build
#
ifeq ($(OS),Darwin)
# WARNS = -Wno-write-strings
WARNS = -Wno-write-strings -Wall -Wno-unused-variable
all: heather
heather.o: heather.cpp heather.ch heathfnt.ch makefile
$(CC) -c heather.cpp $(WARNS) -I/opt/X11/include
heathmsc.o: heathmsc.cpp heather.ch heathfnt.ch makefile
$(CC) -c heathmsc.cpp $(WARNS) -I/opt/X11/include
heathui.o: heathui.cpp heather.ch heathfnt.ch makefile
$(CC) -c heathui.cpp $(WARNS) -I/opt/X11/include
heathgps.o: heathgps.cpp heather.ch heathfnt.ch makefile
$(CC) -c heathgps.cpp $(WARNS) -I/opt/X11/include
heather: heather.o heathmsc.o heathui.o heathgps.o
$(CC) heather.o heathui.o heathgps.o heathmsc.o -o heather -L/usr/X11/lib -lm -lX11
clean:
rm heather.o heathui.o heathgps.o heathmsc.o 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