updated make file to remove user defined files
[otp-base.git] / tools / .appgen / blank_app / src / Makefile
blob4ea70d6c4c55dde2c1dfbc4180757af109c97fda
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 # ----------------------------------------------------
8 # Application version
9 # ----------------------------------------------------
11 include ../vsn.mk
12 APP_NAME=%%APP_NAME%%
13 PFX=%%PFX%%
14 VSN=$(%%APP_NAME_UPPER_CASE%%_VSN)
16 # ----------------------------------------------------
17 # Target Specs
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/,/)
26 HRL_FILES=
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 # ----------------------------------------------------
44 # FLAGS
45 # ----------------------------------------------------
47 ERL_FLAGS +=
48 ERL_COMPILE_FLAGS += -I../include $(shell cat $(APP_NAME).includes)
50 # ----------------------------------------------------
51 # Targets
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
59 # beam files.
60 clean:
61 rm -f $(TARGET_FILES)
62 rm -f core
63 rm -rf $(EBIN)
64 rm -rf *html
65 rm -f erl_crash.dump
66 rm -f *~*
67 rm -f $(APP_NAME).includes
69 $(EBIN):
70 mkdir $(EBIN)
72 # ----------------------------------------------------
73 # Special Build Targets
74 # ----------------------------------------------------
76 $(APP_NAME).includes:
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);' \
85 $< > $<".tmp"
86 sed -e 's/%MODULES%\(.*\),/\1/' \
87 $<".tmp" > $@
88 rm $<".tmp"
91 $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
92 sed -e 's;%VSN%;$(VSN);' $< > $@