# [Makefile wk 19.06.97] To create the import libraries

include ../../../config.mk

DEFS := $(wildcard *.def)

LIBS := $(patsubst %.def, lib%.a, $(notdir $(DEFS)))

.PHONY: all clean install

target_dir := $(PREFIX)/${TARGET}

lib%.a: %.def
	$(DLLTOOL) --def $< --output-lib $@ --as $(AS) \
	    --dllname $(patsubst %.def, %.dll, $(notdir $<)) -k


all: $(LIBS)


install: all
	set -e; for i in $(LIBS) ; do \
	  $(INSTALL) -m 644 $$i $(target_dir)/lib ; done

clean:
	-rm -f *.o *.a *~

