#%ARCHIVE = libip_address.a
#%DEPENDS = unit_test posix_compat
#%TEST_DEPENDS = compat_stringstream iostream_extension std_compat_header_wrapper

CXX = ../../bin/g++w
MAKE_ARCHIVE = ../../bin/make-archive
RM = rm

INCLUDES = -I../unit_test/include -I../posix_compat/include
TEST_INCLUDES = -I../compat_stringstream/include \
		-I../iostream_extension/include \
		-I../std_compat_header_wrapper/include

CXXFLAGS = -g $(CCXXOPTFLAGS) $(CXXOPTFLAGS) \
	      $(INCLUDES) $(TEST_INCLUDES) \
	      $(CCXXADDITIONALFLAGS) $(CXXADDITIONALFLAGS)

LDFLAGS  = $(LDADDITIONALFLAGS)


all: check

library: libip_address.a

library-lean: library
	$(RM) -f *.o

libip_address.a: ip_address.o
	$(MAKE_ARCHIVE) libip_address.a ip_address.o

ip_address-test: ip_address-test.o libip_address.a
	$(CXX) $(CXXFLAGS) -o ip_address-test ip_address-test.o \
	       -L. -lip_address $(LDFLAGS)

check: ip_address-test
	./ip_address-test

clean:
	$(RM) -f *.o libip_address.a ip_address-test

.PHONY: all library library-lean check clean


##
ip_address.o: ip_address.h ip_address.cc

ip_address-test.o: ip_address-test.cc ip_address.h
