Browse Source

remove mk

Maxim Sokhatsky 11 years ago
parent
commit
f17417a0dc
3 changed files with 0 additions and 153 deletions
  1. 0 60
      erl.mk
  2. 0 29
      mk/Makefile
  3. 0 64
      mk/erlang.mk

+ 0 - 60
erl.mk

@@ -1,60 +0,0 @@
-all: deps apps
-.PHONY: all
-
-APPS = $(patsubst apps/*/src/%.app.src,%,$(wildcard apps/*/src/*.app.src))
-
-### DEPS -- Fetches & compiles deps recursively then moves every dep to deps/
-
-deps: $(patsubst dep_%,deps/%/,$(filter dep_%,$(.VARIABLES))) | deps-dir
-	$(if $(wildcard deps/*/deps/), \
-	mv -v deps/*/deps/* deps/ 2>/dev/null ; rmdir $(wildcard deps/*/deps/))
-.PHONY: deps
-
-deps-dir:
-	$(if $(wildcard deps/),,mkdir deps/)
-
-deps/%/:
-	git clone -n -- $(word 1,$(dep_$*)) $@
-	cd $@ && git checkout -q $(word 2,$(dep_$*)) && cd ../..
-	@bash -c "if [[ -f $@/Makefile ]]; \
-	then echo 'make -C $@ all' ; make -C $@ all  ; \
-	else echo 'cd $@ && rebar get-deps compile && cd ../..' ; \
-	cd $@ && rebar get-deps compile && cd ../..  ; fi"
-
-### APP -- Compiles src/ into ebin/
-
-apps: $(APPS) 
-	$(foreach ext, erl xrl yrl S core, \
-	$(patsubst apps/*/src/%.$(ext), apps/*/ebin/%.beam, $(wildcard apps/*/src/*.$(ext)))) \
-	$(patsubst apps/*/templates/%.dtl,  apps/*/ebin/%_dtl.beam,$(wildcard apps/*/templates/*.dtl))
-	echo "-> $@"
-.PHONY: apps
-
-apps/*/ebin/%.app: apps/*/src/%.app.src | apps/*/ebin/
-	@erl -noshell -eval 'case file:consult("$<") of {ok,_} -> ok ; \
-	{error,{_,_,M}} -> io:format("$<: ~s~s\n",M), halt(1) end.' \
-	-s init stop
-	cp $< $@
-	echo "application -> $@"
-
-apps/*/ebin/%.beam: apps/*/src/%.erl $(wildcard apps/*/include/*) | apps/*/ebin/ | deps/*/ebin/
-	erlc -o ebin/ $(ERLCFLAGS) -v -Iinclude/ -Ideps/ $<
-	echo "compile -> $@"
-
-apps/*/ebin/%_view.beam: apps/*/priv/templates/%.html | apps/*/ebin/
-	$(if $(wildcard deps/erlydtl/),, \
-	$(error Error compiling $<: deps/erlydtl/ not found))
-	@erl -noshell -pa ebin/ -pa deps/*/ebin/ \
-	-eval 'io:format("Compiling ErlyDTL template: $< -> $@\n").' \
-	-eval 'erlydtl:compile("$<", $*_view, [{out_dir,"ebin/"},{auto_escape,false}]).' \
-	-s init stop
-	echo "template -> $@"
-
-apps/*/ebin/:
-	mkdir ebin/
-	echo "-> $@"
-
-#clean:
-#	$(if $(wildcard apps/*/ebin/),rm -r ebin/)
-
-#.PHONY: clean

+ 0 - 29
mk/Makefile

@@ -1,29 +0,0 @@
-DEPS = $(wildcard deps/*)
-APPS = apps/face apps/server
-SUBDIRS := $(DEPS) $(APPS)
-#SUBDIRS = deps/shen
-
-MKINCDIR ?= /Users/skif/devel/git.hub.kakaranet/games/mk
-
-indir = /Users/skif/devel/git.hub.kakaranet/games/
-outdir = /Users/skif/devel/git.hub.kakaranet/games/
-
-export VERBOSE = @
-export DEVNULL = >/dev/null
-SILENT = -s
-
-ifeq "$(V)" "1"
-VERBOSE =
-DEVNULL =
-SILENT = 
-endif
-
-all: build
-
-
-clean compile:
-	$(VERBOSE)cd $(indir) && \
-	for d in $(SUBDIRS); do \
-		$(MAKE) $(SILENT) -C $(indir)/$${d} -f $(MKINCDIR)/erlang.mk indir=$(indir)/$${d} outdir=$(outdir)/$${d} subdir=$${d} $@ || break; \
-	done
-

+ 0 - 64
mk/erlang.mk

@@ -1,64 +0,0 @@
-ERLC ?= erlc
-ERL ?= erl
-INSTALL ?= install 
-INSTALL_FLAGS ?= -D -m 0644
-
-indir? = 
-outdir? = 
-
-ifeq "$(indir)" ""
-$(error "in dir not specified")
-endif
-
-ifeq "$(outdir)" ""
-$(error "out dir not specified")
-endif
-
-libdir ?= ../../deps
-ebindir = ebin
-srcdir = src
-
-parse_transform_modules = $(foreach erl,$(wildcard $(srcdir)/*erl), $(shell grep -h "compile.*parse_transform" $(erl) | sed -e 's@-compile({parse_transform,\(.*\)}).@\1@' | sort -u | while read mod; do test -f $(srcdir)/$${mod}.erl && echo $${mod}; done))
-
-erl_modules = $(foreach erl,$(wildcard $(srcdir)/*erl), $(notdir $(basename $(shell grep -q "compile.*parse_transform" $(erl) || echo $(erl)))))
-
-#erl_src_files = $(notdir $(basename $(wildcard $(srcdir)/*erl)))
-erl_src_files = $(call parse_transform_modules) $(call erl_modules)
-beam_out_files = $(addprefix $(ebindir)/,$(addsuffix .beam, $(erl_src_files)))
-
-app_src_files = $(notdir $(basename $(wildcard $(srcdir)/*app.src)))
-app_out_files = $(addprefix $(ebindir)/,$(app_src_files))
-
-PATHA ?= $(addprefix -pa ,$(wildcard $(libdir)/*/ebin))
-ERLCFLAGS = -I. -I.. -I../../deps -Iinclude $(PATHA) -I$(outdir) -I$(outdir)/include
-
-$(ebindir)/%.beam: $(srcdir)/%.erl
-	$(VERBOSE)echo "[beam]" $(subdir)/$@
-	$(VERBOSE)$(ERLC) $(ERLCFLAGS) -o $(ebindir) $^
-
-$(ebindir)/%.app: $(srcdir)/%.app.src
-	$(VERBOSE)echo "[app]" $(subdir)/$@
-	$(VERBOSE)erl -noshell \
-		-eval 'case file:consult("$<") of {ok,_} -> ok ; \
-		{error,{L,M,T}} -> io:format("$<: ~s ~s ~s ~n", [L,M,T]), halt(1) end.' \
-		-s init stop
-	$(VERBOSE)cp $< $@
-
-mkdir = $(outdir) $(ebindir) $(outdir)/include $(outdir)/src $(etcdir)
-
-prepare: $(mkdir)
-
-$(mkdir):
-	$(VERBOSE)echo "[mkdir]" $@
-	$(VERBOSE)mkdir -p $@
-
-compile: $(beam_out_files) $(app_out_files) $(etc_out_files) $(priv_out_files)
-
-clean_files = $(beam_out_files)	$(app_out_files) $(etc_out_files)
-
-clean:
-ifneq "$(clean_files)" ""
-	$(VERBOSE)rm -f $(clean_files)
-endif
-
-.PHONY: clean build prepare