PageRenderTime 20ms CodeModel.GetById 1ms app.highlight 15ms RepoModel.GetById 1ms app.codeStats 0ms

/Makefile

https://code.google.com/p/zotonic/
Makefile | 55 lines | 42 code | 13 blank | 0 comment | 17 complexity | 614f064cfca0cf5e21354dcc180c5a5f MD5 | raw file
 1ERL       ?= erl
 2ERLC      ?= $(ERL)c
 3EBIN_DIRS := $(wildcard deps/*/ebin)
 4APP       := zotonic
 5PARSER     =src/erlydtl/erlydtl_parser
 6
 7all: gen_smtp iconv z_logger mochiweb webmachine module-deps $(PARSER).erl erl ebin/$(APP).app 
 8
 9erl:
10	@$(ERL) -pa $(EBIN_DIRS) -pa ebin -noinput +B \
11	  -eval 'case make:all() of up_to_date -> halt(0); error -> halt(1) end.'
12
13$(PARSER).erl: $(PARSER).yrl
14	$(ERLC) -o src/erlydtl $(PARSER).yrl
15
16gen_smtp:
17	cd deps/gen_smtp && $(MAKE)
18
19iconv:
20	cd deps/iconv && ./rebar compile
21
22z_logger:
23	cd deps/z_logger && $(MAKE)
24
25mochiweb:
26	cd deps/mochiweb && $(MAKE)
27
28webmachine:
29	cd deps/webmachine && $(MAKE)
30
31module-deps:
32	@if [ "`find modules/ -name Makefile`" != "" ]; then for f in modules/*/Makefile; do echo $$f; $(MAKE) -C `dirname $$f`; done; fi
33	@if [ "`find priv/modules/ -name Makefile`" != "" ]; then for f in priv/modules/*/Makefile; do echo $$f; $(MAKE) -C `dirname $$f`; done; fi
34	@if [ "`find priv/sites/*/modules/ -name Makefile`" != "" ]; then for f in priv/sites/*/modules/*/Makefile; do echo $$f; $(MAKE) -C `dirname $$f`; done; fi
35
36docs:
37	@erl -noshell -run edoc_run application '$(APP)' '"."' '[]'
38
39clean: 
40	@echo "removing:"
41	(cd deps/gen_smtp; $(MAKE) clean)
42	(cd deps/z_logger; $(MAKE) clean)
43	(cd deps/mochiweb; $(MAKE) clean)
44	(cd deps/webmachine; $(MAKE) clean)
45	(cd deps/iconv; ./rebar clean)
46	@if [ "`find modules/ -name Makefile`" != "" ]; then for f in modules/*/Makefile; do echo $$f; $(MAKE) -C `dirname $$f` clean; done; fi
47	@if [ "`find priv/modules/ -name Makefile`" != "" ]; then for f in priv/modules/*/Makefile; do echo $$f; $(MAKE) -C `dirname $$f` clean; done; fi
48	@if [ "`find priv/sites/*/modules/ -name Makefile`" != "" ]; then for f in priv/sites/*/modules/*/Makefile; do echo $$f; $(MAKE) -C `dirname $$f` clean; done; fi
49	rm -f ebin/*.beam ebin/*.app
50	rm -f erl_crash.dump $(PARSER).erl
51	rm -f priv/log/*
52
53ebin/$(APP).app:
54	cp src/$(APP).app $@
55