-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (24 loc) · 1.15 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
CFLAGS=-Wall -Wextra -Wshadow -O2 -ggdb -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_ISOC99_SOURCE -DVERBOSE -DSYSLOG #-DFORK
LDFLAGS=-Wl,--as-needed
MQ_LIBS=-lrt
DB_LIBS=-lpq
INSTALL=install
.PHONY: all clean install
all: pulsemon pulsedb heatingdb pulsefake
clean:
rm -f pulsemon pulsedb heatingdb pulsefake
prefix=/usr
exec_prefix=$(prefix)
libdir=$(exec_prefix)/lib
install: all
$(INSTALL) -m 755 -D pulsedb $(DESTDIR)$(libdir)/arduino-mux/pulsedb
$(INSTALL) -m 755 -D heatingdb $(DESTDIR)$(libdir)/arduino-mux/heatingdb
$(INSTALL) -m 755 -D pulsefake $(DESTDIR)$(libdir)/arduino-mux/pulsefake
pulsemon: pulsemon.c pulsemon.h pulseq.h Makefile
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(MQ_LIBS)
pulsedb: pulsedb.c pulsedb.h pulseq.h Makefile pulsedb_postgres.c pulsedb_postgres.h
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(MQ_LIBS) pulsedb_postgres.c $(DB_LIBS)
heatingdb: pulsedb.c pulsedb.h pulseq.h Makefile pulsedb_postgres.c pulsedb_postgres.h
$(CC) $(CFLAGS) $(LDFLAGS) '-DTABLE="heating"' '-DNO_RESET' -o $@ $< $(MQ_LIBS) pulsedb_postgres.c $(DB_LIBS)
pulsefake: pulsefake.c pulsefake.h pulseq.h Makefile
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(MQ_LIBS)