2016-02-07 09:30:33 -08:00
|
|
|
OUT := rmtfs
|
|
|
|
|
2018-07-02 09:50:10 -07:00
|
|
|
CFLAGS += -Wall -g -O2
|
2019-04-15 16:21:28 +05:30
|
|
|
LDFLAGS += -lqrtr -ludev -lpthread
|
2018-07-02 09:50:10 -07:00
|
|
|
prefix = /usr/local
|
2019-07-25 11:15:03 -07:00
|
|
|
bindir := $(prefix)/bin
|
|
|
|
servicedir := $(prefix)/lib/systemd/system
|
2016-02-07 09:30:33 -08:00
|
|
|
|
2024-02-07 14:43:38 +01:00
|
|
|
RMTFS_EFS_PATH ?= /var/lib/rmtfs
|
|
|
|
|
2019-04-15 16:21:28 +05:30
|
|
|
SRCS := qmi_rmtfs.c rmtfs.c rproc.c sharedmem.c storage.c util.c
|
2016-02-07 09:30:33 -08:00
|
|
|
OBJS := $(SRCS:.c=.o)
|
|
|
|
|
|
|
|
$(OUT): $(OBJS)
|
|
|
|
$(CC) -o $@ $^ $(LDFLAGS)
|
|
|
|
|
2016-02-07 21:33:54 -08:00
|
|
|
%.c: %.qmi
|
2018-01-31 20:56:57 -08:00
|
|
|
qmic -k < $<
|
2016-02-07 21:33:54 -08:00
|
|
|
|
2024-02-07 14:43:38 +01:00
|
|
|
%.service: %.service.in
|
|
|
|
@sed -e 's+RMTFS_PATH+$(bindir)+g' -e 's+RMTFS_EFS_PATH+$(RMTFS_EFS_PATH)+g' $< > $@
|
2019-07-25 11:15:03 -07:00
|
|
|
|
2024-02-07 14:43:38 +01:00
|
|
|
install: $(OUT) rmtfs.service rmtfs-dir.service
|
2019-07-25 11:15:03 -07:00
|
|
|
@install -D -m 755 $(OUT) $(DESTDIR)$(prefix)/bin/$(OUT)
|
|
|
|
@install -D -m 644 rmtfs.service $(DESTDIR)$(servicedir)/rmtfs.service
|
2024-02-07 14:43:38 +01:00
|
|
|
@install -D -m 644 rmtfs-dir.service $(DESTDIR)$(servicedir)/rmtfs-dir.service
|
2016-02-07 09:30:33 -08:00
|
|
|
|
|
|
|
clean:
|
2019-07-25 11:15:03 -07:00
|
|
|
rm -f $(OUT) $(OBJS) rmtfs.service
|
2024-02-07 14:43:38 +01:00
|
|
|
rm -f $(OUT) $(OBJS) rmtfs-dir.service
|
2016-02-07 09:30:33 -08:00
|
|
|
|