|
@@ -274,6 +274,59 @@ endif
|
|
true = ID =/= [], \
|
|
true = ID =/= [], \
|
|
halt()"
|
|
halt()"
|
|
|
|
|
|
|
|
+core-app-compile-first: init
|
|
|
|
+
|
|
|
|
+ $i "Bootstrap a new OTP library named $(APP)"
|
|
|
|
+ $t mkdir $(APP)/
|
|
|
|
+ $t cp ../erlang.mk $(APP)/
|
|
|
|
+ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
|
|
|
|
+
|
|
|
|
+ $i "Generate .erl files"
|
|
|
|
+ $t echo "-module(boy)." > $(APP)/src/boy.erl
|
|
|
|
+ $t echo "-module(girl)." > $(APP)/src/girl.erl
|
|
|
|
+ $t echo "-module(first)." > $(APP)/src/first.erl
|
|
|
|
+
|
|
|
|
+ $i "Define COMPILE_FIRST"
|
|
|
|
+ $t echo "COMPILE_FIRST = first" >> $(APP)/Makefile
|
|
|
|
+
|
|
|
|
+ $i "Build the application"
|
|
|
|
+ $t $(MAKE) -C $(APP) $v
|
|
|
|
+
|
|
|
|
+ $i "Check that the application was compiled correctly"
|
|
|
|
+ $t $(ERL) -pa $(APP)/ebin/ -eval " \
|
|
|
|
+ ok = application:start($(APP)), \
|
|
|
|
+ {ok, Mods = [boy, first, girl]} \
|
|
|
|
+ = application:get_key($(APP), modules), \
|
|
|
|
+ [{module, M} = code:load_file(M) || M <- Mods], \
|
|
|
|
+ halt()"
|
|
|
|
+
|
|
|
|
+core-app-compile-first-sub-directory: init
|
|
|
|
+
|
|
|
|
+ $i "Bootstrap a new OTP library named $(APP)"
|
|
|
|
+ $t mkdir $(APP)/
|
|
|
|
+ $t cp ../erlang.mk $(APP)/
|
|
|
|
+ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
|
|
|
|
+
|
|
|
|
+ $i "Generate .erl files"
|
|
|
|
+ $t echo "-module(boy)." > $(APP)/src/boy.erl
|
|
|
|
+ $t echo "-module(girl)." > $(APP)/src/girl.erl
|
|
|
|
+ $t mkdir $(APP)/src/sub/
|
|
|
|
+ $t echo "-module(first)." > $(APP)/src/sub/first.erl
|
|
|
|
+
|
|
|
|
+ $i "Define COMPILE_FIRST with a module in a sub-directory"
|
|
|
|
+ $t echo "COMPILE_FIRST = sub/first" >> $(APP)/Makefile
|
|
|
|
+
|
|
|
|
+ $i "Build the application"
|
|
|
|
+ $t $(MAKE) -C $(APP) $v
|
|
|
|
+
|
|
|
|
+ $i "Check that the application was compiled correctly"
|
|
|
|
+ $t $(ERL) -pa $(APP)/ebin/ -eval " \
|
|
|
|
+ ok = application:start($(APP)), \
|
|
|
|
+ {ok, Mods = [boy, first, girl]} \
|
|
|
|
+ = application:get_key($(APP), modules), \
|
|
|
|
+ [{module, M} = code:load_file(M) || M <- Mods], \
|
|
|
|
+ halt()"
|
|
|
|
+
|
|
ifndef LEGACY
|
|
ifndef LEGACY
|
|
core-app-env: init
|
|
core-app-env: init
|
|
|
|
|