aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: d6843427e757e977807685f2d680f46095b5a46e (plain)
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
PREFIX = /usr/local

all: remote_plot

list.o: list.c list.h
	cc -Wall -c $<

remote_plot.o: remote_plot.c
	cc -Wall $$(pkg-config --cflags --libs libssh plplot gtk4) -lm -c $<

remote_plot: list.o remote_plot.o
#	raspberry pi debian 12 make error `ld: undefined reference to ...` if use `cc -Wall $$(pkg-config --cflags --libs libssh plplot gtk4) -lm -o $@ $^`. No error if move $^ to the beginning. Not sure why, maybe becuase pi has an old version of gcc?
	cc $^ -Wall $$(pkg-config --cflags --libs libssh plplot gtk4) -lm -o $@

clean:
	rm -f remote_plot remote_plot.o list.o

install: all
	mkdir -p ${DESTDIR}${PREFIX}/bin
	cp -f remote_plot ${DESTDIR}${PREFIX}/bin

uninstall:
	rm -f ${DESTDIR}${PREFIX}/bin/remote_plot

.PHONY: all clean install uninstall