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 \ |
Amit Pundir | aab5ced | 2020-04-16 10:02:40 +0530 | [diff] [blame] | 11 | assoc.c \ |
| 12 | json.c \ |
Amit Pundir | d477f82 | 2020-02-07 22:26:08 +0530 | [diff] [blame] | 13 | servreg_loc.c |
| 14 | |
| 15 | OBJS := $(SRCS:.c=.o) |
| 16 | |
| 17 | $(PD_MAPPER): $(OBJS) |
| 18 | $(CC) -o $@ $^ $(LDFLAGS) |
| 19 | |
| 20 | pd-mapper.service: pd-mapper.service.in |
| 21 | @sed 's+PD_MAPPER_PATH+$(bindir)+g' $< > $@ |
| 22 | |
| 23 | install: $(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 | |
| 27 | clean: |
| 28 | rm -f $(PD_MAPPER) $(OBJS) pd-mapper.service |