-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
28 lines (26 loc) · 860 Bytes
/
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
pwd = $(shell pwd)
objects = main.o jsmn.o
test: main.c libsunrise-sunset.so
gcc -L$(pwd) -Wall -Werror -o test main.c -lm -lsunrise-sunset
libsunrise-sunset.so: sunrise_sunset.o jsmn.o
gcc -shared -Wall -o libsunrise-sunset.so sunrise_sunset.o jsmn.o
sunrise_sunset.o: sunrise_sunset.c jsmn.h
gcc -c -Wall -Werror -fpic sunrise_sunset.c
deb: libsunrise-sunset.so
mkdir -p libsunrise-sunset/usr/local/lib
cp libsunrise-sunset.so libsunrise-sunset/usr/local/lib
cp -r DEBIAN libsunrise-sunset/
dpkg-deb --build libsunrise-sunset
.PHONY: install
install:
cp libsunrise-sunset.so /usr/local/lib/
chmod 0755 /usr/local/lib/libsunrise-sunset.so
ldconfig
.PHONY: uninstall
uninstall:
rm /usr/local/lib/libsunrise-sunset.so
ldconfig
.PHONY: clean
clean:
rm -f test libsunrise-sunset.deb libsunrise-sunset.so sunrise_sunset.o
rm -rf libsunrise-sunset/