blob: b42e0056cace5068cbd4d743a6587ccf2a8688e1 [file] [log] [blame]
Christopher Piro094823a2007-07-18 00:26:12 +00001# $Id: Makefile,v 1.3 2004/08/13 16:35:59 mlogan Exp $
2#
Christopher Piro93a06642007-09-18 06:23:33 +00003include ../build/otp.mk
4include ../build/colors.mk
5include ../build/buildtargets.mk
Christopher Piro094823a2007-07-18 00:26:12 +00006
7# ----------------------------------------------------
8# Application version
9# ----------------------------------------------------
10
11include ../vsn.mk
12APP_NAME=thrift
13PFX=thrift
14VSN=$(THRIFT_VSN)
15
16# ----------------------------------------------------
17# Install directory specification
18# WARNING: INSTALL_DIR the command to install a directory.
19# INSTALL_DST is the target directory
20# ----------------------------------------------------
21INSTALL_DST = $(ERLANG_OTP)/lib/$(APP_NAME)-$(VSN)
22
23# ----------------------------------------------------
24# Target Specs
25# ----------------------------------------------------
26
27
28MODULES = $(shell find -name \*.erl | sed s:^\\./:: | sed s/\\.erl//)
29MODULES_STRING_LIST = $(shell find -name \*.erl | sed s:^\\./:\": | sed s/\\.erl/\",/)
30
31HRL_FILES=
32INTERNAL_HRL_FILES= $(APP_NAME).hrl
33ERL_FILES= $(MODULES:%=%.erl)
34DOC_FILES=$(ERL_FILES)
35
36APP_FILE= $(APP_NAME).app
37APPUP_FILE= $(APP_NAME).appup
38
39APP_SRC= $(APP_FILE).src
40APPUP_SRC= $(APPUP_FILE).src
41
42APP_TARGET= $(EBIN)/$(APP_FILE)
43APPUP_TARGET= $(EBIN)/$(APPUP_FILE)
44
45BEAMS= $(MODULES:%=$(EBIN)/%.$(EMULATOR))
46TARGET_FILES= $(BEAMS) $(APP_TARGET) $(APPUP_TARGET)
47
48WEB_TARGET=/var/yaws/www/$(APP_NAME)
49
50# ----------------------------------------------------
51# FLAGS
52# ----------------------------------------------------
53
54ERL_FLAGS +=
55ERL_COMPILE_FLAGS += -I../include -I../../fslib/include -I../../system_status/include
56
57# ----------------------------------------------------
58# Targets
59# ----------------------------------------------------
60
61all debug opt: $(EBIN) $(TARGET_FILES)
62
63#$(EBIN)/rm_logger.beam: $(APP_NAME).hrl
Christopher Piro93a06642007-09-18 06:23:33 +000064include ../build/docs.mk
Christopher Piro094823a2007-07-18 00:26:12 +000065
66# Note: In the open-source build clean must not destroy the preloaded
67# beam files.
68clean:
69 rm -f $(TARGET_FILES)
Christopher Piro68940292007-10-02 00:35:12 +000070 rm -f *~
Christopher Piro094823a2007-07-18 00:26:12 +000071 rm -f core
72 rm -rf $(EBIN)
73 rm -rf *html
74
75$(EBIN):
76 mkdir $(EBIN)
77
78# ----------------------------------------------------
79# Special Build Targets
80# ----------------------------------------------------
81
82$(APP_TARGET): $(APP_SRC) ../vsn.mk $(BEAMS)
83 sed -e 's;%VSN%;$(VSN);' \
84 -e 's;%PFX%;$(PFX);' \
85 -e 's;%APP_NAME%;$(APP_NAME);' \
86 -e 's;%MODULES%;%MODULES%$(MODULES_STRING_LIST);' \
87 $< > $<".tmp"
88 sed -e 's/%MODULES%\(.*\),/\1/' \
89 $<".tmp" > $@
90 rm $<".tmp"
91
92
93$(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
94 sed -e 's;%VSN%;$(VSN);' $< > $@
95
96$(WEB_TARGET): ../markup/*
97 rm -rf $(WEB_TARGET)
98 mkdir $(WEB_TARGET)
99 cp -r ../markup/ $(WEB_TARGET)
100 cp -r ../skins/ $(WEB_TARGET)
101
102# ----------------------------------------------------
103# Install Target
104# ----------------------------------------------------
105
106install: all $(WEB_TARGET)
107# $(INSTALL_DIR) $(INSTALL_DST)/src
108# $(INSTALL_DATA) $(ERL_FILES) $(INSTALL_DST)/src
109# $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(INSTALL_DST)/src
110# $(INSTALL_DIR) $(INSTALL_DST)/include
111# $(INSTALL_DATA) $(HRL_FILES) $(INSTALL_DST)/include
112# $(INSTALL_DIR) $(INSTALL_DST)/ebin
113# $(INSTALL_DATA) $(TARGET_FILES) $(INSTALL_DST)/ebin