CUR_REL_PATH := sigmet
PACKAGE := base-sigmet

include ../config.mk

ifdef ENABLE_NLS
  SUBDIRS = po
endif

INST_INCLUDES = iris_utils.h  sigmet_headers.h  sigmet_utils.h
LIB = libsigmet.a

SIGMET_C_OBJS =	iris_utils.o \
		sigmet_utils.o

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

PRE_CPPFLAGS += -I./
CFLAGS += -g -O0 -std=c99 -fPIC

all : $(LIB)
	$(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) $@;)

clean:
	$(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) $@;)
	rm -f *.o *~ *.a *.d *.d.bak $(LIB)

test:
	$(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) $@;)

install: all #$(IRIS_INCLUDE) $(IRIS_LIB)
#	$(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) $@;)
#	install -m 0664 -o $(IRIS_USER) -g $(IRIS_GROUP) $(INST_INCLUDES) $(IRIS_INCLUDE)
#	install -m 0664 -o $(IRIS_USER) -g $(IRIS_GROUP) $(LIB) $(IRIS_LIB)

uninstall:
#	$(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) $@;)
#	if [ -d $(IRIS_LIB) ]; then cd $(IRIS_LIB) && rm -f $(LIB); fi
#	if [ -d $(IRIS_INCLUDE) ]; then \
#		cd $(IRIS_INCLUDE) && rm -f $(INST_INCLUDES); fi

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

$(OBJS): Makefile

-include $(DEPS)
