forked from MalcolmRobb/dump1090
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (30 loc) · 1.27 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
#
# When building a package or installing otherwise in the system, make
# sure that the variable PREFIX is defined, e.g. make PREFIX=/usr/local
#
PROGNAME=dump1090
ifdef PREFIX
BINDIR=$(PREFIX)/bin
SHAREDIR=$(PREFIX)/share/$(PROGNAME)
EXTRACFLAGS=-DHTMLPATH=\"$(SHAREDIR)\"
endif
CFLAGS=-O2 -g -Wall -W `pkg-config --cflags librtlsdr`
LIBS=`pkg-config --libs librtlsdr` -lpthread -lm
#CC=gcc
all: dump1090 view1090
%.o: %.c
$(CC) $(CFLAGS) $(EXTRACFLAGS) -c $<
dump1090: dump1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o
$(CC) -g -o dump1090 dump1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o $(LIBS) $(LDFLAGS)
view1090: view1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o
$(CC) -g -o view1090 view1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o $(LIBS) $(LDFLAGS)
clean:
rm -f *.o dump1090 view1090
install: dump1090
install -m 0755 dump1090 $(prefix)/bin
mkdir -p $(prefix)/share/dump1090/public_html/coolclock
install -m 0644 public_html/*.html $(prefix)/share/dump1090/public_html
install -m 0644 public_html/*.js $(prefix)/share/dump1090/public_html
install -m 0644 public_html/*.css $(prefix)/share/dump1090/public_html
install -m 0644 public_html/coolclock/*.js $(prefix)/share/dump1090/public_html/coolclock
.PHONY: install