1 # $Id: Makefile,v 1.3 2004/08/13 16:35:59 mlogan Exp $
3 include ..
/..
/..
/build
/otp.mk
4 include ..
/..
/..
/build
/colors.mk
5 include ..
/..
/..
/build
/buildtargets.mk
7 # ----------------------------------------------------
9 # ----------------------------------------------------
14 VSN
=$(%%APP_NAME_UPPER_CASE
%%_VSN
)
16 # ----------------------------------------------------
18 # ----------------------------------------------------
20 ERLWARE_LIB_PATH
=$(ERLWARE_HOME
)/application_packages
/$(TARGET_ERTS_VSN
)/lib
21 FSLIB_DIR
=$(ERLWARE_LIB_PATH
)/$(shell ls
$(ERLWARE_LIB_PATH
) | grep fslib |
sort -r | head
-n
1)
23 MODULES
= $(shell ls
*.erl | sed s
/.erl
//)
24 MODULES_COMMA
= $(shell ls
*.erl | sed s
/\\.erl
/,/)
27 INTERNAL_HRL_FILES
= $(APP_NAME
).hrl
28 ERL_FILES
= $(MODULES
:%=%.erl
)
29 DOC_FILES
=$(ERL_FILES
)
31 APP_FILE
= $(APP_NAME
).app
32 APPUP_FILE
= $(APP_NAME
).appup
34 APP_SRC
= $(APP_FILE
).src
35 APPUP_SRC
= $(APPUP_FILE
).src
37 APP_TARGET
= $(EBIN
)/$(APP_FILE
)
38 APPUP_TARGET
= $(EBIN
)/$(APPUP_FILE
)
40 BEAMS
= $(MODULES
:%=$(EBIN
)/%.
$(EMULATOR
))
41 TARGET_FILES
= $(BEAMS
) $(APP_TARGET
) $(APPUP_TARGET
)
43 # ----------------------------------------------------
45 # ----------------------------------------------------
48 ERL_COMPILE_FLAGS
+= -I..
/include $(shell cat
$(APP_NAME
).includes
)
50 # ----------------------------------------------------
52 # ----------------------------------------------------
54 all debug opt
: $(APP_NAME
).includes
$(EBIN
) $(TARGET_FILES
)
56 include ..
/..
/..
/build
/docs.mk
58 # Note: In the open-source build clean must not destroy the preloaded
67 rm -f
$(APP_NAME
).includes
72 # ----------------------------------------------------
73 # Special Build Targets
74 # ----------------------------------------------------
77 $(ERL
) -pz
$(FSLIB_DIR
)/ebin
-noshell
-s fs_lib commandline_apply fs_boot_smithe write_out_include_dirs \
78 [\"$(ERLWARE_LIB_PATH
)/*\",\"..
/..
/*\"] \"$(APP_NAME
).app.src
\" \"$@
\" -s init stop
80 $(APP_TARGET
): $(APP_SRC
) ..
/vsn.mk
$(BEAMS
)
81 sed
-e
's;%VSN%;$(VSN);' \
82 -e
's;%PFX%;$(PFX);' \
83 -e
's;%APP_NAME%;$(APP_NAME);' \
84 -e
's;%MODULES%;%MODULES%$(MODULES_COMMA);' \
86 sed
-e
's/%MODULES%\(.*\),/\1/' \
91 $(APPUP_TARGET
): $(APPUP_SRC
) ..
/vsn.mk
92 sed
-e
's;%VSN%;$(VSN);' $< > $@