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