aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/deps.mk33
-rw-r--r--packages.v2.tsv9
-rw-r--r--plugins/c_src.mk16
-rw-r--r--plugins/relx.mk4
4 files changed, 44 insertions, 18 deletions
diff --git a/core/deps.mk b/core/deps.mk
index 27eefe5..9491b3f 100644
--- a/core/deps.mk
+++ b/core/deps.mk
@@ -22,10 +22,10 @@ endif
endif
export ERL_LIBS
-PKG_FILE ?= $(CURDIR)/.erlang.mk.packages.v1
+PKG_FILE ?= $(CURDIR)/.erlang.mk.packages.v2
export PKG_FILE
-PKG_FILE_URL ?= https://raw.githubusercontent.com/extend/erlang.mk/master/packages.v1.tsv
+PKG_FILE_URL ?= https://raw.githubusercontent.com/extend/erlang.mk/master/packages.v2.tsv
# Core targets.
@@ -42,17 +42,20 @@ distclean:: distclean-deps distclean-pkg
# Deps related targets.
+define dep_fetch_git
+ git clone -n -- $(2) $(DEPS_DIR)/$(1)
+ cd $(DEPS_DIR)/$(1) ; git checkout -q $(3)
+endef
+
define dep_fetch
@mkdir -p $(DEPS_DIR)
-ifeq (,$(findstring pkg://,$(word 1,$(dep_$(1)))))
- git clone -n -- $(word 1,$(dep_$(1))) $(DEPS_DIR)/$(1)
-else
+ifeq (,$(dep_$(1)))
@if [ ! -f $(PKG_FILE) ]; then $(call core_http_get,$(PKG_FILE),$(PKG_FILE_URL)); fi
- git clone -n -- `awk 'BEGIN { FS = "\t" }; \
- $$$$1 == "$(subst pkg://,,$(word 1,$(dep_$(1))))" { print $$$$2 }' \
- $(PKG_FILE)` $(DEPS_DIR)/$(1)
+ $(eval DEP_FETCH_PKG := $(shell awk 'BEGIN { FS = "\t" }; $$1 == "$(1)" { print $$2 " " $$3 " "$$4 }' $(PKG_FILE)))
+ $(call dep_fetch_$(word 1,$(DEP_FETCH_PKG)),$(1),$(word 2,$(DEP_FETCH_PKG)),$(word 3,$(DEP_FETCH_PKG)))
+else
+ $(call dep_fetch_$(word 1,$(dep_$(1))),$(1),$(word 2,$(dep_$(1))),$(word 3,$(dep_$(1))))
endif
- cd $(DEPS_DIR)/$(1) ; git checkout -q $(word 2,$(dep_$(1)))
endef
define dep_target
@@ -73,17 +76,17 @@ $(PKG_FILE):
pkg-list: $(PKG_FILE)
@cat $(PKG_FILE) | awk 'BEGIN { FS = "\t" }; { print \
"Name:\t\t" $$1 "\n" \
- "Repository:\t" $$2 "\n" \
- "Website:\t" $$3 "\n" \
- "Description:\t" $$4 "\n" }'
+ "Repository:\t" $$3 "\n" \
+ "Website:\t" $$5 "\n" \
+ "Description:\t" $$6 "\n" }'
ifdef q
pkg-search: $(PKG_FILE)
@cat $(PKG_FILE) | grep -i ${q} | awk 'BEGIN { FS = "\t" }; { print \
"Name:\t\t" $$1 "\n" \
- "Repository:\t" $$2 "\n" \
- "Website:\t" $$3 "\n" \
- "Description:\t" $$4 "\n" }'
+ "Repository:\t" $$3 "\n" \
+ "Website:\t" $$5 "\n" \
+ "Description:\t" $$6 "\n" }'
else
pkg-search:
@echo "Usage: make pkg-search q=STRING"
diff --git a/packages.v2.tsv b/packages.v2.tsv
new file mode 100644
index 0000000..295fad2
--- /dev/null
+++ b/packages.v2.tsv
@@ -0,0 +1,9 @@
+bullet git https://github.com/extend/bullet master http://ninenines.eu Simple, reliable, efficient streaming for Cowboy.
+cowboy git https://github.com/extend/cowboy master http://ninenines.eu Small, fast and modular HTTP server.
+cowlib git https://github.com/extend/cowlib master http://ninenines.eu Support library for manipulating Web protocols.
+erlydtl git https://github.com/erlydtl/erlydtl master https://github.com/erlydtl/erlydtl Django Template Language for Erlang.
+gun git https://github.com/extend/gun master http//ninenines.eu Asynchronous SPDY, HTTP and Websocket client written in Erlang.
+jsx git https://github.com/talentdeficit/jsx master https://github.com/talentdeficit/jsx An Erlang application for consuming, producing and manipulating JSON.
+proper git https://github.com/manopapad/proper master http://proper.softlab.ntua.gr PropEr: a QuickCheck-inspired property-based testing tool for Erlang.
+ranch git https://github.com/extend/ranch master http://ninenines.eu Socket acceptor pool for TCP protocols.
+sheriff git https://github.com/extend/sheriff master http://ninenines.eu Parse transform for type based validation.
diff --git a/plugins/c_src.mk b/plugins/c_src.mk
index e1d8297..63ca6bc 100644
--- a/plugins/c_src.mk
+++ b/plugins/c_src.mk
@@ -11,6 +11,20 @@ C_SRC_ENV ?= $(C_SRC_DIR)/env.mk
C_SRC_OPTS ?=
C_SRC_OUTPUT ?= $(CURDIR)/priv/$(PROJECT).so
+# System type and C compiler/flags.
+
+UNAME_SYS := $(shell uname -s)
+ifeq ($(UNAME_SYS), Darwin)
+ CC ?= cc
+ CFLAGS ?= -O3 -std=c99 -arch x86_64 -flat_namespace -undefined suppress -finline-functions -Wall -Wmissing-prototypes
+else ifeq ($(UNAME_SYS), FreeBSD)
+ CC ?= cc
+ CFLAGS ?= -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+else ifeq ($(UNAME_SYS), Linux)
+ CC ?= gcc
+ CFLAGS ?= -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+endif
+
# Verbosity.
c_src_verbose_0 = @echo " C_SRC " $(?F);
@@ -22,7 +36,7 @@ ifeq ($(wildcard $(C_SRC_DIR)/Makefile),)
app:: $(C_SRC_ENV)
@mkdir -p priv/
- $(c_src_verbose) gcc $(C_SRC_DIR)/*.c -fPIC -shared -o $(C_SRC_OUTPUT) \
+ $(c_src_verbose) $(CC) $(CFLAGS) $(C_SRC_DIR)/*.c -fPIC -shared -o $(C_SRC_OUTPUT) \
-I $(ERTS_INCLUDE_DIR) $(C_SRC_OPTS)
$(C_SRC_ENV):
diff --git a/plugins/relx.mk b/plugins/relx.mk
index c6fd227..f425d12 100644
--- a/plugins/relx.mk
+++ b/plugins/relx.mk
@@ -16,8 +16,8 @@ RELX_URL ?= https://github.com/erlware/relx/releases/download/v1.0.2/relx
RELX_OPTS ?=
RELX_OUTPUT_DIR ?= _rel
-ifneq ($(firstword $(subst -o,,$(RELX_OPTS))),)
- RELX_OUTPUT_DIR = $(firstword $(subst -o,,$(RELX_OPTS)))
+ifeq ($(firstword $(RELX_OPTS)),-o)
+ RELX_OUTPUT_DIR = $(word 2,$(RELX_OPTS))
endif
# Core targets.