-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (31 loc) · 704 Bytes
/
Makefile
File metadata and controls
44 lines (31 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
CC := gcc
PREFIX := /usr/share/usbmount
VERSION := 1.1.5
COOKIE := /run/usbmount
FILES = usbmount@.service usbmount config.h
SED = sed \
-e "s|@PREFIX@|$(PREFIX)|g" \
-e "s|@VERSION@|$(VERSION)|g" \
-e "s|@COOKIE@|$(COOKIE)|g"
all: $(FILES) usbeject
$(FILES): %: %.in
@$(SED) $< > $@
@echo "GEN $@"
CFLAGS := -MMD -MP -g
SRCS := $(usbeject.c)
DEPS := $(SRCS:.c=.c.d)
OBJS := $(SRCS:.c=.c.o)
usbeject: usbeject.c.o
@$(CC) -o $@ $^ $(LDFLAGS)
@echo "GEN $@"
%.c.o: %.c
@$(CC) -o $@ -c $^ $(CFLAGS)
@echo "CC $@"
-include $(DEPS)
define rm
@$(RM) $(1)
@echo "RM $(1)"
endef
clean:
$(foreach f,$(sort $(wildcard *.[do]) usbeject $(FILES)),$(call rm,$(f)))
.PHONY: all clean