works as of old
[otp-base.git] / tools / .appgen / blank_app / src / Makefile
blob13b06f05c8212b7541c210c6d7a89228bb842582
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 # Install directory specification
18 # WARNING: INSTALL_DIR the command to install a directory.
19 # INSTALL_DST is the target directory
20 # ----------------------------------------------------
21 INSTALL_DST = $(ERLANG_OTP)/lib/$(APP_NAME)-$(VSN)
23 # ----------------------------------------------------
24 # Target Specs
25 # ----------------------------------------------------
28 MODULES = $(shell ls *.erl | sed s/.erl//)
29 MODULES_COMMA = $(shell ls *.erl | sed s/\\.erl/,/)
31 HRL_FILES=
32 INTERNAL_HRL_FILES= $(APP_NAME).hrl
33 ERL_FILES= $(MODULES:%=%.erl)
34 DOC_FILES=$(ERL_FILES)
36 APP_FILE= $(APP_NAME).app
37 APPUP_FILE= $(APP_NAME).appup
39 APP_SRC= $(APP_FILE).src
40 APPUP_SRC= $(APPUP_FILE).src
42 APP_TARGET= $(EBIN)/$(APP_FILE)
43 APPUP_TARGET= $(EBIN)/$(APPUP_FILE)
45 BEAMS= $(MODULES:%=$(EBIN)/%.$(EMULATOR))
46 TARGET_FILES= $(BEAMS) $(APP_TARGET) $(APPUP_TARGET)
48 WEB_TARGET=/var/yaws/www/$(APP_NAME)
50 # ----------------------------------------------------
51 # FLAGS
52 # ----------------------------------------------------
54 ERL_FLAGS +=
55 ERL_COMPILE_FLAGS += -I../include -I../../fslib/include -I../../system_status/include
57 # ----------------------------------------------------
58 # Targets
59 # ----------------------------------------------------
61 all debug opt: $(EBIN) $(TARGET_FILES)
63 #$(EBIN)/rm_logger.beam: $(APP_NAME).hrl
64 include ../../../build/docs.mk
66 # Note: In the open-source build clean must not destroy the preloaded
67 # beam files.
68 clean:
69 rm -f $(TARGET_FILES)
70 rm -f core
71 rm -rf $(EBIN)
72 rm -rf *html
74 $(EBIN):
75 mkdir $(EBIN)
77 # ----------------------------------------------------
78 # Special Build Targets
79 # ----------------------------------------------------
81 $(APP_TARGET): $(APP_SRC) ../vsn.mk $(BEAMS)
82 sed -e 's;%VSN%;$(VSN);' \
83 -e 's;%PFX%;$(PFX);' \
84 -e 's;%APP_NAME%;$(APP_NAME);' \
85 -e 's;%MODULES%;%MODULES%$(MODULES_COMMA);' \
86 $< > $<".tmp"
87 sed -e 's/%MODULES%\(.*\),/\1/' \
88 $<".tmp" > $@
89 rm $<".tmp"
92 $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
93 sed -e 's;%VSN%;$(VSN);' $< > $@
95 $(WEB_TARGET): ../markup/*
96 rm -rf $(WEB_TARGET)
97 mkdir $(WEB_TARGET)
98 cp -r ../markup/ $(WEB_TARGET)
99 cp -r ../skins/ $(WEB_TARGET)
101 # ----------------------------------------------------
102 # Install Target
103 # ----------------------------------------------------
105 install: all $(WEB_TARGET)
106 # $(INSTALL_DIR) $(INSTALL_DST)/src
107 # $(INSTALL_DATA) $(ERL_FILES) $(INSTALL_DST)/src
108 # $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(INSTALL_DST)/src
109 # $(INSTALL_DIR) $(INSTALL_DST)/include
110 # $(INSTALL_DATA) $(HRL_FILES) $(INSTALL_DST)/include
111 # $(INSTALL_DIR) $(INSTALL_DST)/ebin
112 # $(INSTALL_DATA) $(TARGET_FILES) $(INSTALL_DST)/ebin