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)
99 EXTRA_OBJS = version.o
101 all: $(MODULE) $(MODULE:.dll=.a)
105 # Special defines needed for config.c
108 -DBINDIR='"$(bindir)"' \
109 -DDLLDIR='"$(dlldir)"' \
110 -DLIB_TO_BINDIR=\"`$(RELPATH) $(libdir) $(bindir)`\" \
111 -DLIB_TO_DLLDIR=\"`$(RELPATH) $(libdir) $(dlldir)`\" \
112 -DBIN_TO_DLLDIR=\"`$(RELPATH) $(bindir) $(dlldir)`\" \
113 -DLIB_TO_DATADIR=\"`$(RELPATH) $(libdir) $(datadir)/wine`\" \
114 -DBIN_TO_DATADIR=\"`$(RELPATH) $(bindir) $(datadir)/wine`\"
116 config.o: config.c $(RELPATH)
117 $(CC) -c $(ALLCFLAGS) -o $@ $(SRCDIR)/config.c $(CONFIGDIRS)
121 libwine.so.$(VERSION): $(OBJS) $(VERSCRIPT) Makefile.in
122 $(LDSHARED) $(OBJS) $(EXTRALIBS) $(LDFLAGS) $(LIBS) -o $@
124 libwine.so.$(SOVERSION): libwine.so.$(VERSION)
125 $(RM) $@ && $(LN_S) libwine.so.$(VERSION) $@
127 libwine.so: libwine.so.$(SOVERSION)
128 $(RM) $@ && $(LN_S) libwine.so.$(SOVERSION) $@
131 $(DLLTOOL) -l $@ -d $(SRCDIR)/wine.def
133 libwine.dll: $(OBJS) wine.def Makefile.in
134 $(DLLWRAP) --def $(SRCDIR)/wine.def -o $@ $(OBJS) $(EXTRALIBS)
136 DYLIB_LDFLAGS = -compatibility_version $(SOVERSION) -current_version $(VERSION)
138 libwine.$(VERSION).dylib: $(OBJS) $(RELPATH) Makefile.in
139 $(LDSHARED) -install_name $(libdir)/$(DYNAME) $(DYLIB_LDFLAGS) $(OBJS) $(EXTRALIBS) $(LDFLAGS) $(LIBS) -o $@
141 libwine.$(SOVERSION).dylib: libwine.$(VERSION).dylib
142 cp -p libwine.$(VERSION).dylib $@ && install_name_tool -id @executable_path/`$(RELPATH) $(bindir) $(libdir)`/$(DYNAME) $@ || $(RM) $@
144 libwine.dylib: libwine.$(SOVERSION).dylib
145 $(RM) $@ && $(LN_S) libwine.$(SOVERSION).dylib $@
149 .PHONY: install-lib-so install-lib-dll install-lib-dylib install-dev-so install-dev-dll install-dev-dylib
151 install-lib-so: libwine.so.$(VERSION) $(DESTDIR)$(libdir) dummy
152 $(INSTALL_PROGRAM) libwine.so.$(VERSION) $(DESTDIR)$(libdir)/libwine.so.$(VERSION)
153 cd $(DESTDIR)$(libdir) && $(RM) libwine.so.$(SOVERSION) && $(LN_S) libwine.so.$(VERSION) libwine.so.$(SOVERSION)
155 install-lib-dll: libwine.dll $(DESTDIR)$(libdir) dummy
156 $(INSTALL_DATA) libwine.dll $(DESTDIR)$(libdir)/libwine.dll
158 install-lib-dylib: libwine.$(VERSION).dylib $(DESTDIR)$(libdir) dummy
159 $(INSTALL_PROGRAM) libwine.$(VERSION).dylib $(DESTDIR)$(libdir)/libwine.$(VERSION).dylib
160 cd $(DESTDIR)$(libdir) && $(RM) libwine.$(SOVERSION).dylib && $(LN_S) libwine.$(VERSION).dylib libwine.$(SOVERSION).dylib
162 install-dev-so: $(DESTDIR)$(libdir) dummy
163 cd $(DESTDIR)$(libdir) && $(RM) libwine.so && $(LN_S) libwine.so.$(VERSION) libwine.so
165 install-dev-dll: libwine.a $(DESTDIR)$(libdir) dummy
166 $(INSTALL_DATA) libwine.a $(DESTDIR)$(libdir)/libwine.a
168 install-dev-dylib: $(DESTDIR)$(libdir) dummy
169 cd $(DESTDIR)$(libdir) && $(RM) libwine.dylib && $(LN_S) libwine.$(VERSION).dylib libwine.dylib
171 install install-lib:: $(LIBEXT:%=install-lib-%)
172 install install-dev:: $(LIBEXT:%=install-dev-%)
175 -cd $(DESTDIR)$(libdir) && $(RM) libwine.a libwine.dll libwine.so libwine.so.$(VERSION) \
176 libwine.so.$(SOVERSION) libwine.dylib libwine.$(VERSION).dylib libwine.$(SOVERSION).dylib
179 (GIT_DIR=$(TOPSRCDIR)/.git git describe HEAD 2>/dev/null || echo "wine-@PACKAGE_VERSION@") | sed -e 's/\(.*\)/const char wine_build[] = "\1";/' >$@ || ($(RM) $@ && exit 1)
181 version.c: version-stamp
182 @cmp -s version-stamp $@ || cp version-stamp $@
185 $(RM) libwine.so.$(SOVERSION) libwine.so.$(VERSION) version.c version-stamp
188 @cd $(TOOLSDIR)/tools && $(MAKE) relpath
190 @DEPENDENCIES@ # everything below this line is overwritten by make depend