Amit Pundir | d477f82 | 2020-02-07 22:26:08 +0530 | [diff] [blame] | 1 | PD_MAPPER := pd-mapper |
| 2 | |
| 3 | CFLAGS := -Wall -g -O2 |
| 4 | LDFLAGS := -lqrtr |
| 5 | |
| 6 | prefix ?= /usr/local |
| 7 | bindir := $(prefix)/bin |
| 8 | servicedir := $(prefix)/lib/systemd/system |
| 9 | |
| 10 | SRCS := pd-mapper.c \ |
| 11 | servreg_loc.c |
| 12 | |
| 13 | OBJS := $(SRCS:.c=.o) |
| 14 | |
| 15 | $(PD_MAPPER): $(OBJS) |
| 16 | $(CC) -o $@ $^ $(LDFLAGS) |
| 17 | |
| 18 | pd-mapper.service: pd-mapper.service.in |
| 19 | @sed 's+PD_MAPPER_PATH+$(bindir)+g' $< > $@ |
| 20 | |
| 21 | install: $(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 | |
| 25 | clean: |
| 26 | rm -f $(PD_MAPPER) $(OBJS) pd-mapper.service |