1PD_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 assoc.c \ 12 json.c \ 13 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 29