#
#	Makefile for the http server library
#
#	Copyright (c) Embedthis Software LLC, 2003-2009. All Rights Reserved.
#

BUILD_NATIVE	:= 0
PRE_DIRS		:= handlers filters connectors modules

include 		.makedep

#
#	Targets to build
#
TARGETS			+= $(BLD_LIB_DIR)/libappweb$(BLD_LIB)


ifeq ($(BLD_FEATURE_STATIC),1)
	SOURCES		= $(shell find . -name '*.c') 
else
	SOURCES		= $(shell ls *.c connectors/*.c filters/*.c handlers/passHandler.c) 
endif
OBJECTS			= $(patsubst %.c,$(BLD_OBJ_DIR)/%$(BLD_OBJ),$(notdir $(SOURCES)))

#
#	Build the targets in this directory first then build all the dynamically loaded modules in the modules directory.
#
compileExtra: $(TARGETS)
ifeq ($(BLD_FEATURE_STATIC),0)
	@T=modules D=handlers ; $(DO_RECURSE)
	@T=modules D=filters  ; $(DO_RECURSE)
	@T=modules D=modules  ; $(DO_RECURSE)
endif

#
#	Build the appweb library
#
$(BLD_LIB_DIR)/libappweb$(BLD_LIB): Makefile $(OBJECTS) $(BLD_MPR_MAKEDEP)
	echo LIBS $(_LIBS)
	@bld --library $(BLD_LIB_DIR)/libappweb --search "$(BLD_APPWEB_LIBPATHS)" --libs "$(BLD_APPWEB_DEP_LIBS)" $(OBJECTS)
