-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
45 lines (37 loc) · 1.2 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
40
41
42
43
44
45
OCAMLBUILD = ocamlbuild
SUBDIRS = lib core implementations plugins tools
IMPLEMENTATION_SYMLINK = regexp-search regexp-search+alt-div symbolic-regression
TOOL_SYMLINK = genpts randpts fuzzpts randstr regexp-classify regexp-eval
all: build-all symlinks
build-all:
$(OCAMLBUILD) all.otarget
$(SUBDIRS): %:
$(OCAMLBUILD) $@/[email protected]
symlinks: $(IMPLEMENTATION_SYMLINK) $(TOOL_SYMLINK)
$(IMPLEMENTATION_SYMLINK): %:
ln -s _build/implementations/$(firstword $(subst +, ,$(subst -,_,$@)))/$(subst +,_,$(subst -,_,$@)).native $@
$(TOOL_SYMLINK): %:
ln -s _build/tools/$(subst -,_,$@).native $@
doc:
$(OCAMLBUILD) GeneTipe.docdir/index.html
clean:
-rm -r _build
-rm $(IMPLEMENTATION_SYMLINK)
-rm $(TOOL_SYMLINK)
sanitize: clean
@echo "Replacing tabs with 4 spaces in OCaml files"
@for f in $$(find . -name "*.ml*"); \
do \
sed -i "s/\t/ /g" $$f ; \
done
@echo "Removing spaces at end of line"
@for f in $$(find . -path './.git' -prune -type f -o -type f); \
do \
sed -i "s/ \+$$//g" $$f ; \
done
@echo "Ensure new line at end of file"
@for f in $$(find . -path './.git' -prune -type f -o -type f); \
do \
sed -i '$$a\' $$f ; \
done
.PHONY: all build-all $(SUBDIRS) symlinks doc clean sanitize