-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
40 lines (30 loc) · 1.05 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
ERLC = erlc
ERL_COMPILE_FLAGS = +debug_info
EBIN_DIR = ebin
ERL_FILES = $(wildcard *.erl)
BEAM_FILES = $(subst .erl,.beam,$(ERL_FILES))
## Create needed folders (if not exist):
$(shell [ -d "diagrams/" ] || mkdir diagrams/)
$(shell [ -d "results/" ] || mkdir results/)
$(shell [ -d "$(EBIN_DIR)/" ] || mkdir $(EBIN_DIR)/)
## Check that certain programs are available
GNUPLOT := $(shell which gnuplot)
ifeq ($(GNUPLOT),)
$(error gnuplot is required but it is not found! Aborting.)
endif
FIG2PS := $(shell which fig2ps)
ifeq ($(FIG2PS),)
$(error fig2ps is required but it is not found! Aborting.)
endif
.PHONY: all check clean distclean
all: $(BEAM_FILES) fasta
@(cd src && make EBIN_DIR=../$(EBIN_DIR) ERLC=$(ERLC) ERL_COMPILE_FLAGS="$(ERL_COMPILE_FLAGS)" $@)
%.beam: %.erl
$(ERLC) $(ERL_COMPILE_FLAGS) -o $(EBIN_DIR) $<
fasta:
gcc fasta.c -o fasta
clean:
$(RM) ebin/$(BEAM_FILES) io_file fasta revcomp-input.txt regexdna-input.txt knucleotide-input.txt
@(cd src && $(MAKE) EBIN_DIR=../$(EBIN_DIR) $@)
distclean: clean
$(RM) -rI diagrams/ results/ ebin/