forked from approach0/search-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (26 loc) · 715 Bytes
/
Makefile
File metadata and controls
34 lines (26 loc) · 715 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
include rules.mk
MODULES := hello hello2 list da-trie txt-seg
MODULES := $(MODULES:=-module)
MODULES_CLEAN := $(MODULES:=-clean)
all: tags $(MODULES)
%-module:
make -C $*
%-module-clean:
make -C $* clean
clean: tags-clean $(MODULES_CLEAN)
SRC_LIST_FILE := srclist.txt
SRC_LIST := $(shell test -e ${SRC_LIST_FILE} && \
cat ${SRC_LIST_FILE})
tags: $(SRC_LIST)
@ echo '[create ctags]'
$(FIND) -name '*.[hcly]' -o \
-name '*.cpp' -o -print > $(SRC_LIST_FILE)
@ if command -v ctags; then \
ctags --langmap=c:.c.y -L $(SRC_LIST_FILE); \
else \
echo 'no ctags command.'; \
fi
tags-clean:
@echo '[tags clean]'
@$(FIND) -type f \( -name 'tags' \) -print | xargs rm -f
@rm -f $(SRC_LIST_FILE)