1 TOPSRCDIR = @top_srcdir@
7 MODULE = libwine.$(LIBEXT)
8 VERSCRIPT = $(SRCDIR)/wine.map
9 EXTRALIBS = $(LIBPORT) @LIBDL@ @CRTLIBS@
10 DEFS = -D__WINESRC__ -DWINE_UNICODE_API=""
14 SONAME = libwine.so.$(SOVERSION)
15 DYNAME = libwine.$(SOVERSION).dylib
17 INSTALLDIRS = $(DESTDIR)$(libdir)
100 EXTRA_OBJS = version.o
102 all: $(MODULE) $(MODULE:.dll=.a)
106 # Special defines needed for config.c
109 -DBINDIR='"$(bindir)"' \
110 -DDLLDIR='"$(dlldir)"' \
111 -DLIB_TO_BINDIR=\"`$(RELPATH) $(libdir) $(bindir)`\" \
112 -DLIB_TO_DLLDIR=\"`$(RELPATH) $(libdir) $(dlldir)`\" \
113 -DBIN_TO_DLLDIR=\"`$(RELPATH) $(bindir) $(dlldir)`\" \
114 -DLIB_TO_DATADIR=\"`$(RELPATH) $(libdir) $(datadir)/wine`\" \
115 -DBIN_TO_DATADIR=\"`$(RELPATH) $(bindir) $(datadir)/wine`\"
117 config.o: config.c $(RELPATH)
118 $(CC) -c $(ALLCFLAGS) -o $@ $(SRCDIR)/config.c $(CONFIGDIRS)
122 libwine.so.$(VERSION): $(OBJS) $(VERSCRIPT) Makefile.in
123 $(LDSHARED) $(OBJS) $(EXTRALIBS) $(LDFLAGS) $(LIBS) -o $@
125 libwine.so.$(SOVERSION): libwine.so.$(VERSION)
126 $(RM) $@ && $(LN_S) libwine.so.$(VERSION) $@
128 libwine.so: libwine.so.$(SOVERSION)
129 $(RM) $@ && $(LN_S) libwine.so.$(SOVERSION) $@
132 $(DLLTOOL) -l $@ -d $(SRCDIR)/wine.def
134 libwine.dll: $(OBJS) wine.def Makefile.in
135 $(DLLWRAP) --def $(SRCDIR)/wine.def -o $@ $(OBJS) $(EXTRALIBS)
137 DYLIB_LDFLAGS = -compatibility_version $(SOVERSION) -current_version $(VERSION)
139 libwine.$(VERSION).dylib: $(OBJS) $(RELPATH) Makefile.in
140 $(LDSHARED) -install_name $(libdir)/$(DYNAME) $(DYLIB_LDFLAGS) $(OBJS) $(EXTRALIBS) $(LDFLAGS) $(LIBS) -o $@
142 libwine.$(SOVERSION).dylib: libwine.$(VERSION).dylib
143 cp -p libwine.$(VERSION).dylib $@ && install_name_tool -id @executable_path/`$(RELPATH) $(bindir) $(libdir)`/$(DYNAME) $@ || $(RM) $@
145 libwine.dylib: libwine.$(SOVERSION).dylib
146 $(RM) $@ && $(LN_S) libwine.$(SOVERSION).dylib $@
150 .PHONY: install-lib-so install-lib-dll install-lib-dylib install-dev-so install-dev-dll install-dev-dylib
152 install-lib-so: libwine.so.$(VERSION) $(DESTDIR)$(libdir) dummy
153 $(INSTALL_PROGRAM) libwine.so.$(VERSION) $(DESTDIR)$(libdir)/libwine.so.$(VERSION)
154 cd $(DESTDIR)$(libdir) && $(RM) libwine.so.$(SOVERSION) && $(LN_S) libwine.so.$(VERSION) libwine.so.$(SOVERSION)
156 install-lib-dll: libwine.dll $(DESTDIR)$(libdir) dummy
157 $(INSTALL_DATA) libwine.dll $(DESTDIR)$(libdir)/libwine.dll
159 install-lib-dylib: libwine.$(VERSION).dylib $(DESTDIR)$(libdir) dummy
160 $(INSTALL_PROGRAM) libwine.$(VERSION).dylib $(DESTDIR)$(libdir)/libwine.$(VERSION).dylib
161 cd $(DESTDIR)$(libdir) && $(RM) libwine.$(SOVERSION).dylib && $(LN_S) libwine.$(VERSION).dylib libwine.$(SOVERSION).dylib
163 install-dev-so: $(DESTDIR)$(libdir) dummy
164 cd $(DESTDIR)$(libdir) && $(RM) libwine.so && $(LN_S) libwine.so.$(VERSION) libwine.so
166 install-dev-dll: libwine.a $(DESTDIR)$(libdir) dummy
167 $(INSTALL_DATA) libwine.a $(DESTDIR)$(libdir)/libwine.a
169 install-dev-dylib: $(DESTDIR)$(libdir) dummy
170 cd $(DESTDIR)$(libdir) && $(RM) libwine.dylib && $(LN_S) libwine.$(VERSION).dylib libwine.dylib
172 install install-lib:: $(LIBEXT:%=install-lib-%)
173 install install-dev:: $(LIBEXT:%=install-dev-%)
176 -cd $(DESTDIR)$(libdir) && $(RM) libwine.a libwine.dll libwine.so libwine.so.$(VERSION) \
177 libwine.so.$(SOVERSION) libwine.dylib libwine.$(VERSION).dylib libwine.$(SOVERSION).dylib
180 (GIT_DIR=$(TOPSRCDIR)/.git git describe HEAD 2>/dev/null || echo "wine-@PACKAGE_VERSION@") | sed -n -e '$$s/\(.*\)/const char wine_build[] = "\1";/p' >$@ || ($(RM) $@ && exit 1)
182 version.c: version-stamp
183 @cmp -s version-stamp $@ || cp version-stamp $@
186 $(RM) libwine.so.$(SOVERSION) libwine.so.$(VERSION) version.c version-stamp
189 @cd $(TOOLSDIR)/tools && $(MAKE) relpath
191 @DEPENDENCIES@ # everything below this line is overwritten by make depend