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
This commit is contained in:
David Reiss 2010-08-30 22:06:01 +00:00
parent df2047e4b1
commit c549f7b086

View File

@ -27,6 +27,7 @@ INSTALL_DST = $(ERLANG_OTP)/lib/$(APP_NAME)-$(VSN)
MODULES = $(shell find . -name \*.erl | sed 's:^\./::' | sed 's/\.erl//') MODULES = $(shell find . -name \*.erl | sed 's:^\./::' | sed 's/\.erl//')
MODULES_STRING_LIST = $(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= HRL_FILES=
INTERNAL_HRL_FILES= $(APP_NAME).hrl INTERNAL_HRL_FILES= $(APP_NAME).hrl
@ -43,7 +44,8 @@ APP_TARGET= $(EBIN)/$(APP_FILE)
APPUP_TARGET= $(EBIN)/$(APPUP_FILE) APPUP_TARGET= $(EBIN)/$(APPUP_FILE)
BEAMS= $(MODULES:%=$(EBIN)/%.$(EMULATOR)) 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) WEB_TARGET=/var/yaws/www/$(APP_NAME)
@ -53,7 +55,8 @@ WEB_TARGET=/var/yaws/www/$(APP_NAME)
ERL_FLAGS += ERL_FLAGS +=
ERL_INCLUDE = -I../include -I../../fslib/include -I../../system_status/include 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 # Targets