[erlang-questions] Use of makefiles

Lev Walkin vlm@REDACTED
Thu Feb 28 14:04:41 CET 2008


Alexander,

the thing is, Makefiles are not going anywhere. The make utility
is available for over thirty years and is now part of pretty much
any standard *ix system (including Apple Mac OS X),
and you can get it for Windows as well.

Makefiles are here to stay. The ROI of learning the basic make
syntax approaches infinity over the years. Learning basic make is
a half an hour job and that knowledge will not be outdated any time
soon, unlike computing environments we're automating with it.

That is, make may not always be the best choice for the specific task,
but it is certainly THE default choice if we talk about compile
time automation.

While your research into the realm of build/deployment cycles
might give you a bit more convenient answer for this specific
task, I would like you to consider sticking with make for a while.

It will pay off.

See inside.

Alexander Lamb wrote:
> Hello list,
> 
> I am starting a project in Erlang. I read Armstrong's book. He  
> indicates he uses makefiles to manage compiling erlang modules.
> 
> Now, I am wondering. Is this overkill? Slightly outdated (makefiles  
> make me think of those sendmail config files: totally weird and  
> impossible to understand)?
> 
> What are the various strategies to manage your build / run or build /  
> deploy cycles?
> 
> Then, what is the strategy used to organize your code?
> 
> I thought having a folder for a project, containing the makefile, then  
> a subdirectory src and a subdirectory ebin
> 
> Unfortunately, I didn't manage to get my makefile work with that  
> setup. Here is my makefile:
> 
> .SUFFIXES: .erl .beam .yrl
> 
> .erl.beam:
> 	erlc -W $<
> 
> .yrl.erl:
> 	erlc -W $<
> 
> ERL = erl -boot start_clean
> 
> MODS = profiles
> 
> all: compile
> 	${ERL} -s profiles start
> 
> compile: ${MODS:%=%.beam}
> 
> clean:
> 	rm -rf *.beam erl_crash.dump
> 
> subdirs:
> 	cd src; make
> 
> Now this works, but only with .erl and .beam files in the main  
> directory.

Just copy this Makefile into that src subdirectory.

> 
> Thanks,
> 
> --
> Alexander Lamb
> Founding Associate
> RODANOTECH Sàrl
> 
> 4 ch. de la Tour de Champel
> 1206 Geneva
> Switzerland
> 
> Tel:  022 347 77 37
> Fax: 022 347 77 38
> 
> http://www.rodanotech.ch
> 
> 
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
> 




More information about the erlang-questions mailing list