-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile.mingw
77 lines (65 loc) · 1.98 KB
/
Makefile.mingw
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
# For GNU make
# Use //switch instead of /switch for Windows commands' switches
#SHELL = %SystemRoot%/System32/cmd.exe
CC = gcc
CXX = g++
LD = ld
AR = ar
RANLIB = ranlib
RC = windres
RM = rm -f
CP = cp
DIFF = diff -w
DEBUG = -O2
#DEBUG = -g
CFLAGS = -Wall -Wshadow -msse2 -mfpmath=sse
CXXFLAGS = -Wall -msse2 -mfpmath=sse -mwindows -Wno-maybe-uninitialized
IPATH = -Ishapelib -Ifltk
LDFLAGS = -s
#LDFLAGS =
LPATH =
LIBS =
XLDFLAGS = -mwindows -static -s
#XLDFLAGS = -mwindows
XLPATH = -Lfltk/mingw-lib
XLIBS = -lfltk_images -lfltk -lfltk_png -lfltk_z -lfltk_jpeg -lpthread -lole32 -luuid -lcomctl32
TGTS = gk-slo.exe gk-shp.exe xgk-slo.exe
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 = deelx.h
YOBJS = flo.o
.SUFFIXES: .cxx
all: $(TGTS)
gk-slo.exe: $(WOBJS)
$(CC) -o $@ $(WOBJS) $(LDFLAGS) $(LPATH) $(LIBS)
gk-shp.exe: $(SOBJS) $(SHPOBJS)
$(CC) -o $@ $(SOBJS) $(SHPOBJS) $(LDFLAGS) $(LPATH) $(LIBS)
xgk-slo.exe: $(XOBJS) $(SHPOBJS) xgk-slo.rc globe.ico
$(RC) $(@:.exe=).rc $(@:.exe=).res.o
$(CXX) -o $@ $(XOBJS) $(SHPOBJS) $(@:.exe=).res.o $(XLDFLAGS) $(XLPATH) $(XLIBS)
flo.exe: $(YOBJS)
$(CXX) -o $@ $(YOBJS) $(XLDFLAGS) $(XLPATH) $(XLIBS)
$(WOBJS): $(INCL)
$(SOBJS): $(INCL)
$(SHPOBJS): $(SHPINCL)
$(XOBJS): $(XINCL)
test: gk-slo.exe # TODO add tests for all $(TGTS)
./gk-slo.exe -x > gk-slo.tmp
$(DIFF) gk-slo.tmp refout-slo.txt
./gk-slo.exe -x -g egm > gk-slo.tmp
$(DIFF) gk-slo.tmp refout-egm.txt
@$(RM) gk-slo.tmp
install: $(TGTS)
@echo Copy gk-slo.exe, gk-shp.exe and xgk-slo.exe to a directory of your choice
clean:
-$(RM) $(WOBJS) $(SOBJS) $(SHPOBJS) $(XOBJS) *.res.o
cleanall: clean
-$(RM) $(TGTS)
.c.o:
$(CC) $(DEBUG) -c $(CFLAGS) $(IPATH) $< -o $@
.cxx.o:
$(CXX) $(DEBUG) -c $(CXXFLAGS) $(IPATH) $< -o $@