-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile.clang
75 lines (63 loc) · 2 KB
/
Makefile.clang
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
# For GNU make
CC = clang
CXX = clang
LD = ld
AR = ar
RANLIB = ranlib
RM = rm -f
CP = cp
DEBUG = -g -coverage -O0
#DEBUG = -g
CFLAGS = -Wall -Wshadow -msse2 -mfpmath=sse
CXXFLAGS = -Wall -msse2 -mfpmath=sse
IPATH = -Ishapelib -Ifltk -I/usr/local/include -I/opt/X11/include
LDFLAGS = -s -coverage
#LDFLAGS =
LPATH =
LIBS = -lm #-lrt
XLDFLAGS = -s -coverage
#XLDFLAGS =
ifeq ($(shell uname),FreeBSD)
XLPATH = -Lfltk/lib -L/usr/local/lib -L/usr/local/lib/fltk-devel
XLIBS = -lfltk_images -lfltk -lX11 -lXft -lXcursor -lXinerama -lfontconfig -lXfixes -lXext -lXpm -lpng -lz -ljpeg -lpthread -lm -lrt
else
XLPATH = -Lfltk/lib -L/usr/local/lib
XLIBS = -lfltk_images -lfltk -lX11 -lXft -lXcursor -lXinerama -lXpm -lpng -lz -ljpeg -lpthread -lm -lrt -lstdc++
#XLIBS = -lfltk_images -lfltk -lfltk_png -lfltk_jpeg -lX11 -lXpm -lz -lpthread -ldl -lm -lrt
endif
TGTS = gk-slo gk-shp #TODO: xgk-slo
WOBJS = gk-slo.o conv_xyz.o util.o geo.o
SOBJS = gk-shp.o conv_shp.o util.o geo.o
INCL = common.h geo.h geoid_slo.h geoid_egm.h aft_gktm.h aft_tmgk.h
SHPOBJS = shapelib/shpopen.o shapelib/dbfopen.o shapelib/safileio.o shapelib/shptree.o
SHPINCL = shapelib/shapefil.h
XOBJS = xgk-slo.o conv_xyz.o conv_shp.o util.o geo.o
XINCL =
.SUFFIXES: .cxx
all: $(TGTS)
gk-slo: $(WOBJS)
$(CC) -o $@ $(WOBJS) $(LDFLAGS) $(LPATH) $(LIBS)
gk-shp: $(SOBJS) $(SHPOBJS)
$(CC) -o $@ $(SOBJS) $(SHPOBJS) $(LDFLAGS) $(LPATH) $(LIBS)
xgk-slo: $(XOBJS) $(SHPOBJS) globe.xpm
$(CXX) -o $@ $(XOBJS) $(SHPOBJS) $(XLDFLAGS) $(XLPATH) $(XLIBS)
$(WOBJS): $(INCL)
$(SOBJS): $(INCL)
$(SHPOBJS): $(SHPINCL)
$(XOBJS): $(XINCL)
test: $(TGTS)
./gk-slo -x > gk-slo.tmp
diff gk-slo.tmp refout-slo.txt
#./gk-slo -x -g egm > gk-slo.tmp
#diff gk-slo.tmp refout-egm.txt
@$(RM) gk-slo.tmp
install: $(TGTS)
@echo Copy gk-slo, gk-shp and xgk-slo to a directory of your choice
clean:
-$(RM) $(WOBJS) $(SOBJS) $(SHPOBJS) $(XOBJS) *.gcno *.gcda
cleanall: clean
-$(RM) $(TGTS)
.c.o:
$(CC) $(DEBUG) -c $(CFLAGS) $(IPATH) $< -o $@
.cxx.o:
$(CXX) $(DEBUG) -c $(CXXFLAGS) $(IPATH) $< -o $@