-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
55 lines (37 loc) · 1.85 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
# this is the makefile for GPSTurbo
KGUILOC=../kgui/
include $(KGUILOC)makefile.in
SRC=acmap.cpp babelglue.cpp basicclasses.cpp drawsettings.cpp filters.cpp \
gcoords.cpp gmap.cpp gpsr.cpp help.cpp lines.cpp msmap.cpp \
ozmap.cpp print.cpp routes.cpp solvers.cpp stickers.cpp tracks.cpp tsmap.cpp uploadxml.cpp \
gpsturbo.cpp notes.cpp art.cpp download.cpp osmap.cpp map.cpp kmap.cpp
OBJ=$(SRC:%.cpp=$(OBJDIR)/%.o) # replaces the .cpp from SRC with .o
PROGRAM=gpsturbo$(EXE)
DEP=makefile_$(OBJDIR).dep
$(OBJDIR)/%.o: %.cpp # combined w/ next line will compile recently changed .cpp files
$(CC) $(CCOPTS) $(SYS) $(KGUILIB_INCLUDES) -o $@ -c $<
.PHONY : all # .PHONY ignores files named all
all: data.cpp _gtext.cpp $(PROGRAM) # all is dependent on $(PROGRAM) to be complete
ifeq ($(SYS),-DMINGW)
RESOBJ=$(OBJDIR)/gpsturbores.o
$(RESOBJ): gpsturbo.rc gpsturbo.ico
windres gpsturbo.rc $(RESOBJ)
endif
$(PROGRAM): $(DEP) $(OBJ) $(RESOBJ) $(KGUILIB_DEP) # $(PROGRAM) is dependent on all of the files in $(OBJ) to exist
$(LINK) $(RESOBJ) $(KGUILIB_LIBPATHS) $(OBJ) $(KGUILIB_LIBS) $(KGUILIB_SYSLIBS) $(LDFLAGS) -o $@
data.cpp:
$(KGUILOC)$(OBJDIR)/kguibig$(EXE) data.big big big/
$(KGUILOC)$(OBJDIR)/bintoc$(EXE) data.big data.cpp
.PHONY : clean # .PHONY ignores files named clean
clean:
-$(RM) $(OBJ) $(RESOBJ) $(PROGRAM) data.cpp data.big _gtext.h _gtext.cpp $(DEP) # '-' causes errors not to exit the process
$(DEP): data.cpp _gtext.cpp
@echo "Generating Dependencies"
mkdir -p $(OBJDIR)
-$(CC) $(KGUILIB_INCLUDES) -E -MM $(SYS) $(CFLAGS) $(SRC) >>$(DEP)
$(KGUILOC)$(OBJDIR)/fixdep$(EXE) $(DEP) $(OBJDIR)/
_gtext.cpp: $(KGUILOCSTR_OUT) gpsloc.txt
$(KGUILOC)$(OBJDIR)/kguilocstr$(EXE) -i gpsloc.txt -p STRING_ -h _gtext.h -c _gtext.cpp
ifeq (,$(findstring clean,$(MAKECMDGOALS)))
-include $(DEP)
endif