-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
86 lines (52 loc) · 1.44 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
# GTG Makefile
# Tools
CPP = /usr/bin/g++
RM = /bin/rm
# Setup
CFLAGS = -g -Wall -fPIC
LIB_SGP4_DIR = Libraries/sgp4
LIB_SHP_DIR = Libraries/shapelib
INCLUDES = -I $(LIB_SGP4_DIR)/libsgp4 -I $(LIB_SHP_DIR)
LIB_SGP4 = $(LIB_SGP4_DIR)/libsgp4/libsgp4.a
LIB_SHP = $(LIB_SHP_DIR)/libshp.a
LIB_GTG_DIR = Source
LIB_GTG = $(LIB_GTG_DIR)/libgtg.a
TEST_DIR = test
TEST_CASES_DIR = $(TEST_DIR)/cases
.PHONY: libs libsgp4 libshp $(LIB_SGP4_DIR) $(LIB_SHP_DIR) $(LIB_GTG_DIR) clean-libs clean-sgp4 clean-shp clean clean-all clean-gtg libgtg gtg test
# Ground Track Generator
default: gtg
gtg: $(LIB_SGP4) $(LIB_SHP) $(LIB_GTG)
$(CPP) $(LIB_GTG) $(LIB_SGP4) $(LIB_SHP) -o $@
# Program Library
$(LIB_GTG): libgtg
libgtg: $(LIB_GTG_DIR)
$(LIB_GTG_DIR):
@echo "# Making libgtg..."
@$(MAKE) --directory=$(LIB_GTG_DIR) lib
# Prerequisite Libraries
libs: libsgp4 libshp
$(LIB_SGP4): libsgp4
$(LIB_SHP): libshp
libsgp4: $(LIB_SGP4_DIR)
libshp: $(LIB_SHP_DIR)
$(LIB_SGP4_DIR):
@echo "# Making libsgp4..."
@$(MAKE) --directory=$(LIB_SGP4_DIR)
$(LIB_SHP_DIR):
@echo "# Making libshp..."
@$(MAKE) --directory=$(LIB_SHP_DIR) lib
# Test
test: gtg
@$(MAKE) --directory=$(TEST_CASES_DIR) test
# Clean
clean: clean-gtg
$(RM) -f gtg
clean-gtg:
$(MAKE) --directory=$(LIB_GTG_DIR) clean
clean-all: clean clean-libs
clean-libs: clean-sgp4 clean-shp
clean-sgp4:
$(MAKE) --directory=$(LIB_SGP4_DIR) clean
clean-shp:
$(MAKE) --directory=$(LIB_SHP_DIR) clean