forked from Bill-Gray/sat_code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
104 lines (80 loc) · 2.72 KB
/
makefile
File metadata and controls
104 lines (80 loc) · 2.72 KB
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
CC=g++
EXE=
RM=rm -f
ifdef CLANG
CC=clang
endif
# I'm using 'mkdir -p' to avoid error messages if the directory exists.
# It may fail on very old systems, and will probably fail on non-POSIX
# systems. If so, change to '-mkdir' and ignore errors.
ifdef MSWIN
EXE=.exe
MKDIR=-mkdir
else
MKDIR=mkdir -p
endif
ifdef XCOMPILE
CC=x86_64-w64-mingw32-g++
EXE=.exe
endif
# You can have your include files in ~/include and libraries in
# ~/lib, in which case only the current user can use them; or
# (with root privileges) you can install them to /usr/local/include
# and /usr/local/lib for all to enjoy.
ifdef GLOBAL
INSTALL_DIR=/usr/local
else
INSTALL_DIR=~
endif
all: get_high$(EXE) mergetle$(EXE) obs_tes2$(EXE) obs_test$(EXE) out_comp$(EXE) \
test_sat$(EXE) test2$(EXE) sat_id$(EXE) sat_id2$(EXE) test_out$(EXE)
CFLAGS=-Wextra -Wall -O3 -pedantic -Wno-unused-parameter
clean:
$(RM) *.o
$(RM) get_high$(EXE)
$(RM) mergetle$(EXE)
$(RM) obs_tes2$(EXE)
$(RM) obs_test$(EXE)
$(RM) out_comp$(EXE)
$(RM) libsatell.a
$(RM) sat_id$(EXE)
$(RM) sat_id2$(EXE)
$(RM) test2$(EXE)
$(RM) test_out$(EXE)
$(RM) test_sat$(EXE)
install:
$(MKDIR) $(INSTALL_DIR)/lib
cp libsatell.a $(INSTALL_DIR)/lib
cp norad.h $(INSTALL_DIR)/include
$(MKDIR) $(INSTALL_DIR)/bin
cp sat_id $(INSTALL_DIR)/bin
uninstall:
rm $(INSTALL_DIR)/lib/libsatell.a
rm $(INSTALL_DIR)/include/norad.h
rm $(INSTALL_DIR)/bin/sat_id
OBJS= sgp.o sgp4.o sgp8.o sdp4.o sdp8.o deep.o basics.o get_el.o common.o tle_out.o
get_high$(EXE): get_high.o get_el.o
$(CC) $(CFLAGS) -o get_high$(EXE) get_high.o get_el.o
mergetle$(EXE): mergetle.o
$(CC) $(CFLAGS) -o mergetle$(EXE) mergetle.o
obs_tes2$(EXE): obs_tes2.o observe.o libsatell.a
$(CC) $(CFLAGS) -o obs_tes2$(EXE) obs_tes2.o observe.o libsatell.a -lm
obs_test$(EXE): obs_test.o observe.o libsatell.a
$(CC) $(CFLAGS) -o obs_test$(EXE) obs_test.o observe.o libsatell.a -lm
out_comp$(EXE): out_comp.o
$(CC) $(CFLAGS) -o out_comp$(EXE) out_comp.o -lm
libsatell.a: $(OBJS)
rm -f libsatell.a
ar rv libsatell.a $(OBJS)
sat_id$(EXE): sat_id.o observe.o libsatell.a
$(CC) $(CFLAGS) -o sat_id$(EXE) sat_id.o observe.o libsatell.a -lm
sat_id2$(EXE): sat_id2.o sat_id.cpp observe.o ../find_orb/cgi_func.cpp libsatell.a
$(CC) $(CFLAGS) -o sat_id2$(EXE) -DON_LINE_VERSION sat_id2.o sat_id.cpp observe.o ../find_orb/cgi_func.cpp libsatell.a -lm
test2$(EXE): test2.o sgp.o libsatell.a
$(CC) $(CFLAGS) -o test2$(EXE) test2.o sgp.o libsatell.a -lm
test_out$(EXE): test_out.o tle_out.o get_el.o sgp4.o common.o
$(CC) $(CFLAGS) -o test_out$(EXE) test_out.o tle_out.o get_el.o sgp4.o common.o -lm
test_sat$(EXE): test_sat.o libsatell.a
$(CC) $(CFLAGS) -o test_sat$(EXE) test_sat.o libsatell.a -lm
.cpp.o:
$(CC) $(CFLAGS) -c $<