Просмотр исходного кода

Update erlang.mk and update paths to start the release

Fixes a couple invalid instructions at the same time.
Loïc Hoguin 11 лет назад
Родитель
Сommit
abcc6e96d8

+ 13 - 9
erlang.mk

@@ -21,7 +21,7 @@ PROJECT ?= $(notdir $(CURDIR))
 PKG_FILE ?= $(CURDIR)/.erlang.mk.packages.v1
 export PKG_FILE
 
-PKG_FILE_URL ?= https://raw.github.com/extend/erlang.mk/master/packages.v1.tsv
+PKG_FILE_URL ?= https://raw.githubusercontent.com/extend/erlang.mk/master/packages.v1.tsv
 
 define get_pkg_file
 	wget --no-check-certificate -O $(PKG_FILE) $(PKG_FILE_URL) || rm $(PKG_FILE)
@@ -58,8 +58,13 @@ ifneq ($(wildcard $(RELX_CONFIG)),)
 RELX ?= $(CURDIR)/relx
 export RELX
 
-RELX_URL ?= https://github.com/erlware/relx/releases/download/v0.6.0/relx
+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)))
+endif
 
 define get_relx
 	wget -O $(RELX) $(RELX_URL) || rm $(RELX)
@@ -73,7 +78,7 @@ $(RELX):
 	@$(call get_relx)
 
 clean-rel:
-	@rm -rf _rel
+	$(gen_verbose) rm -rf $(RELX_OUTPUT_DIR)
 
 endif
 
@@ -111,9 +116,9 @@ clean-all: clean clean-deps clean-docs
 
 app: ebin/$(PROJECT).app
 	$(eval MODULES := $(shell find ebin -type f -name \*.beam \
-		| sed 's/ebin\///;s/\.beam/,/' | sed '$$s/.$$//'))
+		| sed "s/ebin\//'/;s/\.beam/',/" | sed '$$s/.$$//'))
 	$(appsrc_verbose) cat src/$(PROJECT).app.src \
-		| sed 's/{modules,[[:space:]]*\[\]}/{modules, \[$(MODULES)\]}/' \
+		| sed "s/{modules,[[:space:]]*\[\]}/{modules, \[$(MODULES)\]}/" \
 		> ebin/$(PROJECT).app
 
 define compile_erl
@@ -225,8 +230,7 @@ CT_RUN = ct_run \
 	-noshell \
 	-pa $(realpath ebin) $(DEPS_DIR)/*/ebin \
 	-dir test \
-	-logdir logs \
-	$(CT_OPTS)
+	-logdir logs
 
 CT_SUITES ?=
 
@@ -236,7 +240,7 @@ test_$(1): clean deps app build-tests
 	@if [ -d "test" ] ; \
 	then \
 		mkdir -p logs/ ; \
-		$(CT_RUN) -suite $(addsuffix _SUITE,$(1)) ; \
+		$(CT_RUN) -suite $(addsuffix _SUITE,$(1)) $(CT_OPTS) ; \
 	fi
 	$(gen_verbose) rm -f test/*.beam
 endef
@@ -248,7 +252,7 @@ tests: clean deps app build-tests
 	@if [ -d "test" ] ; \
 	then \
 		mkdir -p logs/ ; \
-		$(CT_RUN) -suite $(addsuffix _SUITE,$(CT_SUITES)) ; \
+		$(CT_RUN) -suite $(addsuffix _SUITE,$(CT_SUITES)) $(CT_OPTS) ; \
 	fi
 	$(gen_verbose) rm -f test/*.beam
 

+ 1 - 1
examples/chunked_hello_world/README.md

@@ -12,7 +12,7 @@ $ make
 To start the release in the foreground:
 
 ``` bash
-$ ./_rel/bin/chunked_hello_world_example console
+$ ./_rel/chunked_hello_world_example/bin/chunked_hello_world_example console
 ```
 
 Then point your browser at [http://localhost:8080](http://localhost:8080),

+ 1 - 1
examples/compress_response/README.md

@@ -12,7 +12,7 @@ $ make
 To start the release in the foreground:
 
 ``` bash
-$ ./_rel/bin/compress_response_example console
+$ ./_rel/compress_response_example/bin/compress_response_example console
 ```
 
 Then point your browser at [http://localhost:8080](http://localhost:8080).

+ 1 - 1
examples/cookie/README.md

@@ -12,7 +12,7 @@ $ make
 To start the release in the foreground:
 
 ``` bash
-$ ./_rel/bin/cookie_example console
+$ ./_rel/cookie_example/bin/cookie_example console
 ```
 
 Then point your browser at [http://localhost:8080](http://localhost:8080).

+ 1 - 1
examples/echo_get/README.md

@@ -12,7 +12,7 @@ $ make
 To start the release in the foreground:
 
 ``` bash
-$ ./_rel/bin/echo_get_example console
+$ ./_rel/echo_get_example/bin/echo_get_example console
 ```
 
 Then point your browser at

+ 1 - 1
examples/echo_post/README.md

@@ -12,7 +12,7 @@ $ make
 To start the release in the foreground:
 
 ``` bash
-$ ./_rel/bin/echo_post_example console
+$ ./_rel/echo_post_example/bin/echo_post_example console
 ```
 
 As this example echoes a POST parameter, it is a little more

+ 1 - 1
examples/error_hook/README.md

@@ -12,7 +12,7 @@ $ make
 To start the release in the foreground:
 
 ``` bash
-$ ./_rel/bin/error_hook_example console
+$ ./_rel/error_hook_example/bin/error_hook_example console
 ```
 
 Then point your browser at [http://localhost:8080](http://localhost:8080).

+ 1 - 1
examples/eventsource/README.md

@@ -12,7 +12,7 @@ $ make
 To start the release in the foreground:
 
 ``` bash
-$ ./_rel/bin/eventsource_example console
+$ ./_rel/eventsource_example/bin/eventsource_example console
 ```
 
 Then point your EventSource capable browser at

+ 1 - 1
examples/hello_world/README.md

@@ -12,7 +12,7 @@ $ make
 To start the release in the foreground:
 
 ``` bash
-$ ./_rel/bin/hello_world_example console
+$ ./_rel/hello_world_example/bin/hello_world_example console
 ```
 
 Then point your browser at [http://localhost:8080](http://localhost:8080).

+ 1 - 1
examples/markdown_middleware/README.md

@@ -12,7 +12,7 @@ $ make
 To start the release in the foreground:
 
 ``` bash
-$ ./_rel/bin/hello_world_example console
+$ ./_rel/markdown_middleware_example/bin/markdown_middleware_example console
 ```
 
 Then point your browser at

+ 1 - 1
examples/rest_basic_auth/README.md

@@ -12,7 +12,7 @@ $ make
 To start the release in the foreground:
 
 ``` bash
-$ ./_rel/bin/rest_basic_auth_example console
+$ ./_rel/rest_basic_auth_example/bin/rest_basic_auth_example console
 ```
 
 Then point your browser at [http://localhost:8080](http://localhost:8080).

+ 1 - 1
examples/rest_hello_world/README.md

@@ -12,7 +12,7 @@ $ make
 To start the release in the foreground:
 
 ``` bash
-$ ./_rel/bin/hello_world_example console
+$ ./_rel/rest_hello_world_example/bin/rest_hello_world_example console
 ```
 
 Then point your browser at [http://localhost:8080](http://localhost:8080).

+ 1 - 1
examples/rest_pastebin/README.md

@@ -12,7 +12,7 @@ $ make
 To start the release in the foreground:
 
 ``` bash
-$ ./_rel/bin/rest_pastebin_example console
+$ ./_rel/rest_pastebin_example/bin/rest_pastebin_example console
 ```
 
 Then point your browser at [http://localhost:8080](http://localhost:8080).

+ 1 - 1
examples/rest_stream_response/README.md

@@ -12,7 +12,7 @@ $ make
 To start the release in the foreground:
 
 ``` bash
-$ ./_rel/bin/rest_stream_response_example console
+$ ./_rel/rest_stream_response_example/bin/rest_stream_response_example console
 ```
 
 Then point your browser at [http://localhost:8080](http://localhost:8080).

+ 1 - 1
examples/ssl_hello_world/README.md

@@ -12,7 +12,7 @@ $ make
 To start the release in the foreground:
 
 ``` bash
-$ ./_rel/bin/ssl_hello_world_example console
+$ ./_rel/ssl_hello_world_example/bin/ssl_hello_world_example console
 ```
 
 Then point your browser at [https://localhost:8443](https://localhost:8443).

+ 1 - 1
examples/static_world/README.md

@@ -12,7 +12,7 @@ $ make
 To start the release in the foreground:
 
 ``` bash
-$ ./_rel/bin/static_world_example console
+$ ./_rel/static_world_example/bin/static_world_example console
 ```
 
 The example will serve all the files found in the `priv`

+ 1 - 1
examples/upload/README.md

@@ -12,7 +12,7 @@ $ make
 To start the release in the foreground:
 
 ``` bash
-$ ./_rel/bin/upload_example console
+$ ./_rel/upload_example/bin/upload_example console
 ```
 
 Then point your browser at [http://localhost:8080](http://localhost:8080).

+ 1 - 1
examples/web_server/README.md

@@ -12,7 +12,7 @@ $ make
 To start the release in the foreground:
 
 ``` bash
-$ ./_rel/bin/web_server_example console
+$ ./_rel/web_server_example/bin/web_server_example console
 ```
 
 Then point your browser at [http://localhost:8080](http://localhost:8080)

+ 1 - 1
examples/websocket/README.md

@@ -12,7 +12,7 @@ $ make
 To start the release in the foreground:
 
 ``` bash
-$ ./_rel/bin/websocket_example console
+$ ./_rel/websocket_example/bin/websocket_example console
 ```
 
 Then point your browser at [http://localhost:8080](http://localhost:8080).

+ 1 - 1
guide/getting_started.md

@@ -305,7 +305,7 @@ We can now build and start the release.
 
 ``` bash
 $ make
-$ ./_rel/bin/hello_erlang console
+$ ./_rel/hello_erlang/bin/hello_erlang console
 ```
 
 If you then access `http://localhost:8080` using your browser,