Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 55 lines (42 sloc) 1.475 kb
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 46 47 48 49 50 51 52 53 54
ERL ?= erl
ERLC ?= $(ERL)c
APP := zotonic
PARSER =src/erlydtl/erlydtl_parser

GIT_CHECK := $(shell test -d .git && git submodule update --init)
MAKEFILES := $(shell find -L deps modules priv/sites priv/modules priv/extensions priv/sites/*/modules -maxdepth 2 -name Makefile)

.PHONY: all
all: iconv mimetypes makefile-deps $(PARSER).erl erl ebin/$(APP).app

.PHONY: erl
erl:
@$(ERL) -pa $(wildcard deps/*/ebin) -pa ebin -noinput +B \
-eval 'case make:all() of up_to_date -> halt(0); error -> halt(1) end.'

$(PARSER).erl: $(PARSER).yrl
$(ERLC) -o src/erlydtl $(PARSER).yrl

iconv:
cd deps/iconv && ./rebar compile

mimetypes:
cd deps/mimetypes && ./rebar compile

makefile-deps:
@if [ "${MAKEFILES}" != "" ]; then for f in ${MAKEFILES}; do echo $$f; $(MAKE) -C `dirname $$f`; done; fi

.PHONY: docs edocs
docs:
@echo Building HTML documentation...
cd doc && make stubs && make html
@echo HTML documentation is now available in doc/_build/html/

edocs:
@echo Building reference (edoc) documentation...
bin/zotonic generate-edoc

.PHONY: clean_logs
clean_logs:
@echo "deleting logs:"
rm -f erl_crash.dump $(PARSER).erl
rm -f priv/log/*

.PHONY: clean
clean: clean_logs
@echo "removing:"
(cd deps/iconv; ./rebar clean)
(cd deps/mimetypes; ./rebar clean)
@if [ "${MAKEFILES}" != "" ]; then for f in ${MAKEFILES}; do echo $$f; $(MAKE) -C `dirname $$f` clean; done; fi
rm -f ebin/*.beam ebin/*.app

ebin/$(APP).app:
cp src/$(APP).app $@
Something went wrong with that request. Please try again.