blob: ca58003d6b61e3d41658d7b53d75954a190ff4e6 [file] [log] [blame]
Amit Pundird477f822020-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 \
11 servreg_loc.c
12
13OBJS := $(SRCS:.c=.o)
14
15$(PD_MAPPER): $(OBJS)
16 $(CC) -o $@ $^ $(LDFLAGS)
17
18pd-mapper.service: pd-mapper.service.in
19 @sed 's+PD_MAPPER_PATH+$(bindir)+g' $< > $@
20
21install: $(PD_MAPPER) pd-mapper.service
22 @install -D -m 755 $(PD_MAPPER) $(DESTDIR)$(bindir)/$(PD_MAPPER)
23 @install -D -m 644 pd-mapper.service $(DESTDIR)$(servicedir)/pd-mapper.service
24
25clean:
26 rm -f $(PD_MAPPER) $(OBJS) pd-mapper.service