example of makefile
Fri Nov 30 13:51:36 CET 2001
Salvador Alcaraz Carrasco <salcaraz@REDACTED> writes:
> Please, could you send me a example of makefile for compile serveral
> erlang files and .hrl files (with dependencies).
> For example:
> file2.erl and file3.erl (these files depending of file1.hrl).
> and beam file: myfile.beam
I tried to make a generic one recently:
ERLDIR := /usr/local/lib/erlang
OBJDIR := ../ebin
ERLC_FLAGS := -o $(OBJDIR)
SRC := $(wildcard *.erl)
HEADERS := $(wildcard *.hrl)
EOBJS := $(SRC:%.erl=$(OBJDIR)/%.beam)
## play it safe: rebuild all when header changes
$(OBJDIR)/%.beam: %.erl $(HEADERS)
erlc $(ERLC_FLAGS) $<
Improvements welcome, it'd be nice to have a "plug and play" safe
makefile. This one should probably automatically depend on
../include/*.hrl and other stuff too no doubt.
More information about the erlang-questions