Browse Source

Merge branch 'recompile_erl_on_hrl_change' of git://github.com/crownedgrouse/erlang.mk

Extra changes include:

 *  Not running the target if the ebin/ directory does not exist
 *  Moved the target in the appropriate section in the file
Loïc Hoguin 10 years ago
parent
commit
813ce99c82
2 changed files with 12 additions and 2 deletions
  1. 6 1
      core/erlc.mk
  2. 6 1
      erlang.mk

+ 6 - 1
core/erlc.mk

@@ -23,7 +23,7 @@ xyrl_verbose = $(xyrl_verbose_$(V))
 
 # Core targets.
 
-app:: ebin/$(PROJECT).app
+app:: erlc-include ebin/$(PROJECT).app
 	$(eval MODULES := $(shell find ebin -type f -name \*.beam \
 		| sed "s/ebin\//'/;s/\.beam/',/" | sed '$$s/.$$//'))
 	@if [ -z "$$(grep -E '^[^%]*{modules,' src/$(PROJECT).app.src)" ]; then \
@@ -62,5 +62,10 @@ clean:: clean-app
 
 # Extra targets.
 
+erlc-include:
+	-@if [ -d ebin/ ]; then \
+		find include/ src/ -type f -name \*.hrl -newer ebin -exec touch $(shell find src/ -type f -name "*.erl") \; ; \
+	fi
+
 clean-app:
 	$(gen_verbose) rm -rf ebin/

+ 6 - 1
erlang.mk

@@ -201,7 +201,7 @@ xyrl_verbose = $(xyrl_verbose_$(V))
 
 # Core targets.
 
-app:: ebin/$(PROJECT).app
+app:: erlc-include ebin/$(PROJECT).app
 	$(eval MODULES := $(shell find ebin -type f -name \*.beam \
 		| sed "s/ebin\//'/;s/\.beam/',/" | sed '$$s/.$$//'))
 	@if [ -z "$$(grep -E '^[^%]*{modules,' src/$(PROJECT).app.src)" ]; then \
@@ -240,6 +240,11 @@ clean:: clean-app
 
 # Extra targets.
 
+erlc-include:
+	-@if [ -d ebin/ ]; then \
+		find include/ src/ -type f -name \*.hrl -newer ebin -exec touch $(shell find src/ -type f -name "*.erl") \; ; \
+	fi
+
 clean-app:
 	$(gen_verbose) rm -rf ebin/