-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
77 lines (63 loc) · 1.37 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
# swephelp Makefile
CC = cc
CXX = g++
CFLAGS = -g -O3 -Wall -Werror=declaration-after-statement -std=gnu99
CXXFLAGS = -g -O3 -Wall -std=gnu++14
DESTDIR = /usr/local
# path to swephexp.h and libswe.a
SWEDIR = /usr/local/opt/swisseph
SWHINC = swephelp.h \
swhaspect.h \
swhatlas.h \
swhdatetime.h \
swhdb.h \
swhdbxx.hpp \
swhdef.h \
swhformat.h \
swhgeo.h \
swhmisc.h \
swhraman.h \
swhsearch.h \
swhtimezone.h \
swhwin.h \
swhxx.hpp
SWHOBJ = swhaspect.o \
swhatlas.o \
swhdatetime.o \
swhdb.o \
swhdbxx.o \
swhformat.o \
swhgeo.o \
swhmisc.o \
swhraman.o \
swhsearch.o \
swhtimezone.o \
swhxx.o
.DEFAULT_GOAL := build
.c.o:
$(CC) -c $(CFLAGS) -fPIC -I. -I$(SWEDIR) $<
.cpp.o:
$(CXX) -c $(CXXFLAGS) -fPIC -I. -I$(SWEDIR) $<
libswephelp.a: $(SWHOBJ)
ar rcs $@ $(SWHOBJ)
libswephelp.so: $(SWHOBJ)
$(CC) -shared -o $@ $(SWHOBJ)
test: test.o libswephelp.a
$(CC) $(CFLAGS) -o $@ $< -L. -lswephelp -L$(SWEDIR) -lswe -lm -ldl -lsqlite3
.PHONY: build clean
build: libswephelp.a
clean:
rm -f *.o libswephelp.* test
swhaspect.o: swhaspect.h
swhatlas.o: swhatlas.h
swhdatetime.o: swhdatetime.h swhwin.h
swhdb.o: swhdb.h
swhdbxx.o: swhdb.h swhdbxx.h swhdbxx.hpp
swhformat.o: swhformat.h
swhgeo.o: swhgeo.h swhwin.h
swhmisc.o: swhmisc.h
swhraman.o: swhdef.h swhraman.h
swhsearch.o: swhsearch.h
swhtimezone.o: swhtimezone.h
swhxx.o: swhxx.h swhxx.hpp
# vi: sw=4 ts=4 noet