TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ..
SRCDIR    = @srcdir@
VPATH     = @srcdir@
MODULE    = none

SUBDIRS = \
	port \
	unicode \
	wine \
	wpp

INSTALLSUBDIRS = \
	unicode \
	wine

SYMLINKS = \
	libwine.$(LIBEXT) \
	libwine_port.a \
	libwine_unicode.$(LIBEXT) \
	libwpp.a

@MAKE_RULES@

ALL_SYMLINKS =  $(SYMLINKS) $(SYMLINKS:.so=.so.1) $(SYMLINKS:.dylib=.1.dylib) $(SYMLINKS:.dll=.a)

all: $(SUBDIRS) $(ALL_SYMLINKS)

install-lib:: $(INSTALLSUBDIRS:%=%/__install-lib__)
install-dev:: $(INSTALLSUBDIRS:%=%/__install-dev__)

clean::
	$(RM) $(ALL_SYMLINKS)

# Symlinks

libwine.so libwine.so.1 libwine.dll libwine.dylib libwine.1.dylib libwine.a: wine/libwine.$(LIBEXT)
	$(RM) $@ && $(LN_S) wine/$@ $@

libwine_unicode.so libwine_unicode.so.1 libwine_unicode.dll libwine_unicode.dylib libwine_unicode.1.dylib libwine_unicode.a: unicode/libwine_unicode.$(LIBEXT)
	$(RM) $@ && $(LN_S) unicode/$@ $@

libwine_port.a: port/libwine_port.a
	$(RM) $@ && $(LN_S) port/$@ $@

libwpp.a: wpp/libwpp.a
	$(RM) $@ && $(LN_S) wpp/$@ $@

# Directory dependencies

wine/libwine.$(LIBEXT): wine
unicode/libwine_unicode.$(LIBEXT): unicode
port/libwine_port.a: port
wpp/libwpp.a: wpp

wine wine/__install__ wine/__install-lib__: libwine_port.a

### Dependencies: