-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
39 lines (34 loc) · 1.02 KB
/
Makefile
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
LIBDIR := lib
include $(LIBDIR)/main.mk
$(LIBDIR)/main.mk:
ifneq (,$(shell grep "path *= *$(LIBDIR)" .gitmodules 2>/dev/null))
git submodule sync
git submodule update $(CLONE_ARGS) --init
else
git clone -q --depth 10 $(CLONE_ARGS) \
-b main https://github.com/martinthomson/i-d-template $(LIBDIR)
endif
cddl:: $(addsuffix .cddl,$(drafts))
# run cddl_validate.sh for all changed files
%.cddl: %.md
@for f in $@; do \
echo "Validating $$f"; \
./cddl_validate.sh $$f > /tmp/foo-$$f 2>&1 ; \
if [ $$? -eq 0 ]; then \
echo " OK"; \
else \
echo " ERROR $$? : "; \
echo " debug with: ./cddl_validate.sh $$f"; \
fi; \
done
# override lib/main.mk clean target, to cleanup json and cddl files
.PHONY: clean
clean::
$(MAKE) -f $(LIBDIR)/main.mk $@
-rm -f \
$(addsuffix -[0-9][0-9].{json$(COMMA)cddl},$(drafts)) \
$(addsuffix .{json$(COMMA)cddl},$(drafts))
# override lib/main.mk all target, to also install deps from Gemfile
.PHONY: all
all:: cddl
$(MAKE) -f $(LIBDIR)/main.mk $@