blob: 908dbfd7759a947a7adc991c04f227e9f1988200 [file] [log] [blame]
Amit Pundir33109f72020-02-07 22:26:08 +05301PD_MAPPER := pd-mapper
2
3CFLAGS := -Wall -g -O2
4LDFLAGS := -lqrtr
5
6prefix ?= /usr/local
7bindir := $(prefix)/bin
8servicedir := $(prefix)/lib/systemd/system
9
10SRCS := pd-mapper.c \
Amit Pundir1b297a92020-04-16 10:02:40 +053011 assoc.c \
12 json.c \
Amit Pundir33109f72020-02-07 22:26:08 +053013 servreg_loc.c
14
15OBJS := $(SRCS:.c=.o)
16
17$(PD_MAPPER): $(OBJS)
18 $(CC) -o $@ $^ $(LDFLAGS)
19
20pd-mapper.service: pd-mapper.service.in
21 @sed 's+PD_MAPPER_PATH+$(bindir)+g' $< > $@
22
23install: $(PD_MAPPER) pd-mapper.service
24 @install -D -m 755 $(PD_MAPPER) $(DESTDIR)$(bindir)/$(PD_MAPPER)
25 @install -D -m 644 pd-mapper.service $(DESTDIR)$(servicedir)/pd-mapper.service
26
27clean:
28 rm -f $(PD_MAPPER) $(OBJS) pd-mapper.service