-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
53 lines (45 loc) · 1.69 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
LDMS_EXECUTABLE=ldmsd
SWITCH_EXECUTABLE=ldms
BUILDDIR=
OBJDIR=obj
CC=g++
SRCDIR=src
COMMON=$(SRCDIR)/config_loader.cpp $(SRCDIR)/globals.cpp $(SRCDIR)/logging.cpp
MODULES=$(SRCDIR)/modules/usb_events.cpp $(SRCDIR)/modules/lm_sensors.cpp $(SRCDIR)/modules/network.cpp $(SRCDIR)/modules/checkin.cpp
LDMS_SRC=$(SRCDIR)/ldmsd.cpp $(COMMON) $(MODULES)
SWITCH_SRC=$(SRCDIR)/ldms.cpp $(COMMON) $(SRCDIR)/hash_utils.cpp
IDIR=include
LIBS=-I$(IDIR) -pthread -lsensors -lcrypt
CFLAGS=-Wall
LDMS_FLAGS=-DLDMS_DAEMON
all: ldmsd ldms
$(LDMS_EXECUTABLE): $(LDMS_SRC)
$(CC) $(CFLAGS) $(LDMS_FLAGS) $(LIBS) $(LDMS_SRC) -o $@
$(SWITCH_EXECUTABLE): $(SWITCH_SRC)
$(CC) $(CFLAGS) $(LIBS) $(SWITCH_SRC) -o $@
debug: CFLAGS += -g
debug: all
install: $(LDMS_EXECUTABLE) $(SWITCH_EXECUTABLE)
install $(LDMS_EXECUTABLE) /usr/bin/
install $(SWITCH_EXECUTABLE) /usr/bin/
install -m 644 ldmsd.service /usr/lib/systemd/system/
install -m 644 ldmsd.timer /usr/lib/systemd/system/
install -m 644 -D example.conf /var/lib/ldms/example.conf
ifeq (,$(wildcard /etc/ldms/ldmsd.conf))
install -m 644 -D example.conf /etc/ldms/ldmsd.conf
endif
gzip man/ldms.1 -c > man/ldms.1.gz
gzip man/ldmsd.1 -c > man/ldmsd.1.gz
gzip man/ldmsd.conf.5 -c > man/ldmsd.conf.5.gz
install -m 644 man/ldms.1.gz /usr/share/man/man1/ldms.1.gz
install -m 644 man/ldmsd.1.gz /usr/share/man/man1/ldmsd.1.gz
install -m 644 man/ldmsd.conf.5.gz /usr/share/man/man5/ldmsd.conf.5.gz
uninstall:
rm /usr/bin/$(LDMS_EXECUTABLE)
rm /usr/bin/$(SWITCH_EXECUTABLE)
rm /usr/lib/systemd/system/ldmsd.service
rm /usr/lib/systemd/system/ldmsd.timer
rm -rf /var/lib/ldms
rm /usr/share/man/man1/ldms.1.gz
rm /usr/share/man/man1/ldmsd.1.gz
rm /usr/share/man/man5/ldmsd.conf.5.gz