#C*
#
# Vaisala software source code file
#
# Copyright (c) Vaisala Oyj 2011. All rights reserved.
#
# $URL: https://subversion.vaisala.com/svn/repos/sigmet/wr_iris_rda/branches/release8.13.4/iris/sws_lib/Makefile $
#
# $Id: Makefile 29659 2013-11-04 20:17:24Z sip $
#
#C#

CUR_REL_PATH := iris/sws_lib

DEBUG = 1

include ../../config.mk

TEST_APPS := test_sws
APPS := $(TEST_APPS)
LIB = libsws.a

APPS_OBJS = $(patsubst %,%.o,$(APPS))
LIB_OBJS :=  	\
 report.o	\
 station.o    	\
 bulletin.o	\
 metar_parser.o	\
 synop_parser.o

OBJS := $(APPS_OBJS) $(LIB_OBJS)
DEPS := $(patsubst %.o,%.d,$(OBJS))

CPPFLAGS += -Wall -MMD
LDFLAGS += -lstdc++ -lboost_unit_test_framework  -lboost_date_time -lm
LDLIBS += -lmisc -lhimath -luser -lz

all: $(LIB_DIR)/$(LIB) $(APPS)

install: all $(IRIS_LIB)
	install -m 0664 -o $(IRIS_USER) -g $(IRIS_GROUP) $(LIB) $(IRIS_LIB)

test: $(TEST_APP)
	./test_sws

uninstall:
	rm -f $(IRIS_LIB)/$(LIB)

clean:
	@rm -f $(APPS) *.o *.a *.d *.d.bak *~ $(LIB_DIR)/$(LIB)

$(LIB): $(LIB_OBJS)
	rm -f $@; $(AR) -rsc $@ $^

test_sws: $(LIB_DIR)/$(LIB)

$(OBJS): Makefile

-include $(DEPS)
