Amit Pundir | 33109f7 | 2020-02-07 22:26:08 +0530 | [diff] [blame] | 1 | OUT := rmtfs |
| 2 | |
| 3 | CFLAGS += -Wall -g -O2 |
| 4 | LDFLAGS += -lqrtr -ludev -lpthread |
| 5 | prefix = /usr/local |
| 6 | bindir := $(prefix)/bin |
| 7 | servicedir := $(prefix)/lib/systemd/system |
| 8 | |
| 9 | SRCS := qmi_rmtfs.c rmtfs.c rproc.c sharedmem.c storage.c util.c |
| 10 | OBJS := $(SRCS:.c=.o) |
| 11 | |
| 12 | $(OUT): $(OBJS) |
| 13 | $(CC) -o $@ $^ $(LDFLAGS) |
| 14 | |
| 15 | %.c: %.qmi |
| 16 | qmic -k < $< |
| 17 | |
| 18 | rmtfs.service: rmtfs.service.in |
| 19 | @sed 's+RMTFS_PATH+$(bindir)+g' $< > $@ |
| 20 | |
| 21 | install: $(OUT) rmtfs.service |
| 22 | @install -D -m 755 $(OUT) $(DESTDIR)$(prefix)/bin/$(OUT) |
| 23 | @install -D -m 644 rmtfs.service $(DESTDIR)$(servicedir)/rmtfs.service |
| 24 | |
| 25 | clean: |
| 26 | rm -f $(OUT) $(OBJS) rmtfs.service |
| 27 | |