include watcom.mk

LIBNAME = aui

SRCDIRS = c $(POSIX_DIR)/misc

INCDIRS += $(POSIX_DIR)/h h $(WATCOM_DIR)/h $(GUI_DIR)/h

vpath %.c $(SRCDIRS)
vpath %.h $(INCDIRS)
vpath %.rc $(INCDIRS)

AUIRC = aui.rc

all	: h/auistr.h $(OBJDIR)/lib$(LIBNAME).a $(DLGS)

include unix/objfiles.mk
OBJECTS := $(foreach i,$(objfiles),$(OBJDIR)/$i)

h/auistr.h	: h/aui.msg $(OBJDIR)/mkstr
	$(OBJDIR)/mkstr h/auistr.h

$(OBJDIR)/mkstr	: mkstr.c
	$(CC) $(CFLAGS) $< -o $@

$(OBJDIR)/lib$(LIBNAME).a : $(OBJDIR)/lib$(LIBNAME).a( $(OBJECTS) ) $(AUIRC)

.PHONY	: clean
clean	:
	rm -f $(OBJDIR)/*.[ocha]

.PHONY	: dep depend make
dep depend make:
	$(MKMK) -Q -m .depend -a foo nopath \
		-f '$$(OBJDIR)/lib$$(LIBNAME).a( $$(OBJDIR)/%s )' nopath \
		$(foreach i,$(SRCDIRS),$i/*.[ch]) \
		$(foreach i,$(INCDIRS),$i/*.h)

ifeq (.depend,$(wildcard .depend))
include .depend
endif


