From: David Reiss Date: Mon, 30 Aug 2010 22:06:01 +0000 (+0000) Subject: erlang: Eliminate "behaviour undefined" warnings X-Git-Tag: 0.5.0~103 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=c549f7b08622dd96060f9596bae3547d00b7db7c;p=common%2Fthrift.git erlang: Eliminate "behaviour undefined" warnings Build behaviour modules first and include the ebin directory in the Erlang code path during the rest of the build. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991002 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/erl/src/Makefile b/lib/erl/src/Makefile index 980af812..78af14f6 100644 --- a/lib/erl/src/Makefile +++ b/lib/erl/src/Makefile @@ -27,6 +27,7 @@ INSTALL_DST = $(ERLANG_OTP)/lib/$(APP_NAME)-$(VSN) MODULES = $(shell find . -name \*.erl | sed 's:^\./::' | sed 's/\.erl//') MODULES_STRING_LIST = $(shell find . -name \*.erl | sed 's:^\./:":' | sed 's/\.erl/",/') +BEHAV_MODULES = $(shell find . -name \*.erl | xargs grep -l behaviour_info | sed 's:^\./::' | sed 's/\.erl//') HRL_FILES= INTERNAL_HRL_FILES= $(APP_NAME).hrl @@ -43,7 +44,8 @@ APP_TARGET= $(EBIN)/$(APP_FILE) APPUP_TARGET= $(EBIN)/$(APPUP_FILE) BEAMS= $(MODULES:%=$(EBIN)/%.$(EMULATOR)) -TARGET_FILES= $(BEAMS) $(APP_TARGET) $(APPUP_TARGET) +BEHAV_BEAMS= $(BEHAV_MODULES:%=$(EBIN)/%.$(EMULATOR)) +TARGET_FILES= $(BEHAV_BEAMS) $(BEAMS) $(APP_TARGET) $(APPUP_TARGET) WEB_TARGET=/var/yaws/www/$(APP_NAME) @@ -53,7 +55,8 @@ WEB_TARGET=/var/yaws/www/$(APP_NAME) ERL_FLAGS += ERL_INCLUDE = -I../include -I../../fslib/include -I../../system_status/include -ERL_COMPILE_FLAGS += $(ERL_INCLUDE) +ERL_BEHAV_PATH = -pz ../ebin +ERL_COMPILE_FLAGS += $(ERL_INCLUDE) $(ERL_BEHAV_PATH) # ---------------------------------------------------- # Targets