This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROJECT = ttt | |
DEPS = stuff | |
dep_stuff = git https://github.com/essen/stuff master | |
include erlang.mk | |
-include $(DEPS_DIR)/stuff/dist.mk | |
$(DEPS_DIR)/stuff/dist.mk: $(DEPS_DIR)/stuff ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
== .erl .core | |
module.erl: header.hrl behavior.erl parse_transform.erl | |
module.core: | |
ebin/$(PROJECT).app:: $(ERL_FILES) $(CORE_FILES) | |
erlc ... $? | |
== .xrl .yrl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% CI_OTP="OTP-17.4.1 OTP-17.5.3" make ci | |
/home/essen/ninenines/gun/kerl build git https://github.com/erlang/otp OTP-17.4.1 OTP-17.4.1 | |
Checking Erlang/OTP git repository from https://github.com/erlang/otp... | |
Building Erlang/OTP OTP-17.4.1 from git, please wait... | |
Erlang/OTP OTP-17.4.1 from git has been successfully built | |
/home/essen/ninenines/gun/kerl install OTP-17.4.1 /home/essen/erlang/OTP-17.4.1 | |
Installing Erlang/OTP git (OTP-17.4.1) in /home/essen/erlang/OTP-17.4.1... | |
You can activate this installation running the following command: | |
. /home/essen/erlang/OTP-17.4.1/activate | |
Later on, you can leave the installation typing: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ERL_CFLAGS = -fPIC -I /usr/lib/erlang/erts-6.4/include -I /usr/lib/erlang/lib/erl_interface-3.7.20/include | |
ERL_LDFLAGS = -L /usr/lib/erlang/lib/erl_interface-3.7.20/lib -lerl_interface -lei | |
EPCAP_CFLAGS= -DHAVE_PCAP_CREATE | |
EXE_LDFLAGS = -lpcap $(ERL_LDFLAGS) | |
EXE_CFLAGS = $(EPCAP_CFLAGS) | |
EXE_CFLAGS = $(EPCAP_CFLAGS) -DEPCAP_RLIMIT_NOFILES=1 | |
all:: ../priv/epcap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(goldrush). | |
application:start(goldrush) | |
%% Start daemons under goldrush supervision tree. | |
start_daemon(Name, Module, Options) | |
stop_daemon(Name) | |
%% Daemons started this way must define: | |
start_link(Name, Options) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(map_req). | |
-export([init/2]). | |
init(#{method := <<"GET">>} = Req, State) -> | |
cowboy_req:reply(204, Req), | |
{ok, Req, State}. |
A common concern with REST APIs is how do you version them? The answer is often something like put the version in the beginning of the URI path. But that’s a terrible advice. This prevents you to make small updates to your API, because you need to duplicate everything every time you increase the version.
A good way to version an API is to not do it. Instead, you can version the media types.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include erlang.mk | |
ifdef SKIP_DEPS | |
deps:: | |
$(verbose) for dep in $(ALL_APPS_DIRS) ; do \ | |
mkdir -p $$dep/ebin; \ | |
done | |
$(verbose) for dep in $(ALL_APPS_DIRS) ; do \ | |
$(MAKE) -C $$dep IS_APP=1 || exit $$?; \ | |
done |
OlderNewer