PROJECT = cowboy -PROJECT_DESCRIPTION = Small, fast, modular HTTP server. -PROJECT_VERSION = 2.0.0-pre.2 -PROJECT_REGISTERED = cowboy_clock - -LOCAL_DEPS = crypto -DEPS = cowlib ranch
From c807880f7ac73f813b2660ea81a00f7712a4e793 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?=
PROJECT_MOD
++ The application callback module. +
+PROJECT_REGISTERED
There’s no need for quotes or anything. The relevant part of the Cowboy Makefile follows, if you need an example:
PROJECT = cowboy -PROJECT_DESCRIPTION = Small, fast, modular HTTP server. -PROJECT_VERSION = 2.0.0-pre.2 -PROJECT_REGISTERED = cowboy_clock - -LOCAL_DEPS = crypto -DEPS = cowlib ranch
Any space before and after the value is dropped.
Dependencies are covered in details in the next chapter.
By default, Erlang.mk will set the following options:
ERLC_OPTS = -Werror +debug_info +warn_export_vars +warn_shadow_vars +warn_obsolete_guard
In other words: warnings as errors, debug info (recommended) and enable warnings for exported variables, shadow variables and obsolete guard functions.
You can redefine this variable in your Makefile to change it completely, either before or after including Erlang.mk:
ERLC_OPTS = +debug_info
You can also filter out some options from the defaults Erlang.mk
sets, by defining ERLC_OPTS after including Erlang.mk using the
:=
operator.
include erlang.mk - -ERLC_OPTS := $(filter-out -Werror,$(ERLC_OPTS))
To exclude a module, simply list it in the variable, either before or after including Erlang.mk:
ERLC_EXCLUDE = cowboy_http2
NO_MAKEDEP ?= 1
As you can see, the snippet above uses ?=
instead of a
simple equal sign. This is to allow you to temporarily override
this value when you do make substantial changes to your project
@@ -559,18 +535,7 @@ file is generated. To do this, you would add your hook before
or after including the erlang.mk file.
The easiest way is after:
PROJECT = example - -include erlang.mk - -$(PROJECT).d:: src/generated_mod.erl - -src/generated_mod.erl:: gen-mod.sh - $(gen_verbose) ./gen-mod.sh $@
In this case we use $(gen_verbose)
to hide the details of
the build by default. Erlang.mk will simply say what file
is it currently generating.
.DEFAULT_GOAL
variable,
otherwise nothing will get built:
PROJECT = example - -.DEFAULT_GOAL = all - -$(PROJECT).d:: src/generated_mod.erl - -include erlang.mk - -src/generated_mod.erl:: gen-mod.sh - $(gen_verbose) ./gen-mod.sh $@