# Makefile for stofa/libasyncns-0.3


### Requires these modules

REQUIRES += base/c


### Component specification

COMPONENT_TARGETS = $(TARGET_NAME_VIP)
COMPONENT_IS_3PP = true
NEEDS_ABS_PATHS = true


### Tar archive

tar_archive = $(CURDIR)/libasyncns-0.3.tar.gz
src_dir     = $(CURDIR)/$(TARGET)/libasyncns-0.3


### Targets

LIB_TARGETS += $(src_dir)/libasyncns/.libs/libasyncns.so.0.1.0
LIB_TARGETS += $(src_dir)/libasyncns/.libs/libasyncns.so.0
LIB_TARGETS += $(src_dir)/libasyncns/.libs/libasyncns.so

INTERFACE_HEADERS += $(src_dir)/libasyncns/asyncns.h

INTERFACE_OMIT_SOURCE_DIR = yes

INTERFACE_LIBS = asyncns

DOC_TARGETS = $(src_dir)/README
DOC_OMIT_SOURCE_DIR = yes
DOC_PATH = ../doc/doc

CONFIGURE_VARS=ac_cv_func_malloc_0_nonnull=yes

### Common.mk

include ../../makesystem/common.mk


### Dependencies

$(src_dir)/configure: $(tar_archive)
	@echo "Expanding $(^F)"
	@tar xzf $^ -C $(TARGET)
	@touch $@

$(src_dir)/Makefile: $(src_dir)/configure
	@cd $(src_dir) && $(BSG_DEVSETUP) $(CONFIGURE_VARS) $(src_dir)/configure --host=sh4-motorola-linux-gnu --disable-lynx

$(INTERFACE_HEADERS): $(src_dir)/Makefile

$(LIB_TARGETS): $(src_dir)/Makefile
	@$(BSG_DEVSETUP) $(MAKE) -C $(src_dir)
