blob: f7b5928280148b04c4049568f92713ad882f494b [file] [log] [blame]
Alexandre Julliarde2991ea1995-07-29 13:09:43 +00001# This Makefile understands the following targets:
2#
3# all (default): build wine
4# clean: remove all intermediate files
5# distclean: also remove all files created by configure
Alexandre Julliard641ee761997-08-04 16:34:36 +00006# install: install everything
Alexandre Julliard85ed45e1998-08-22 19:03:56 +00007# uninstall: uninstall everything
Alexandre Julliarde2991ea1995-07-29 13:09:43 +00008# depend: create the dependencies
Alexandre Julliard641ee761997-08-04 16:34:36 +00009# etags: create a TAGS file for Emacs.
Alexandre Julliard44ed71f1997-12-21 19:17:50 +000010# manpages: compile manpages for Wine API
Alexandre Julliarde2991ea1995-07-29 13:09:43 +000011#
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000012
Alexandre Julliard641ee761997-08-04 16:34:36 +000013# Directories
14
15TOPSRCDIR = @top_srcdir@
16TOPOBJDIR = .
17SRCDIR = @srcdir@
18VPATH = @srcdir@
Alexandre Julliard318f4ce2000-01-31 05:02:49 +000019LIBEXT = @LIBEXT@
Alexandre Julliardd0edc5f2000-03-04 22:31:27 +000020LDSHARED = @LDSHARED@
21LDCONFIG = @LDCONFIG@
Alexandre Julliard0adad952000-01-26 01:45:58 +000022MODULE = wine
23SOVERSION = 1.0
Alexandre Julliardd0edc5f2000-03-04 22:31:27 +000024SONAME = libwine.so
Alexandre Julliard641ee761997-08-04 16:34:36 +000025
Eric Poueche5efa0c2000-04-13 19:31:58 +000026# Stand-alone programs
Alexandre Julliardd327fcb2000-01-29 20:02:49 +000027PROGRAMS = \
28 loader/dos/dosmod \
Alexandre Julliard59b0d7b2000-04-23 20:41:04 +000029 server/wineserver
Alexandre Julliardd327fcb2000-01-29 20:02:49 +000030
Eric Poueche5efa0c2000-04-13 19:31:58 +000031# Programs that link with libwine
32LIBPROGRAMS = \
33 debugger/winedbg
34
Alexandre Julliard2f158c22000-06-14 21:45:38 +000035# Sub-directories to run make depend/clean into
Alexandre Julliardc53ceba2000-04-09 18:19:59 +000036SUBDIRS = \
Alexandre Julliard2f158c22000-06-14 21:45:38 +000037 console \
38 controls \
39 debugger \
40 dlls \
41 dlls/advapi32 \
Alexandre Julliard2f158c22000-06-14 21:45:38 +000042 dlls/ntdll \
43 documentation \
44 files \
45 graphics \
46 graphics/enhmetafiledrv \
47 graphics/metafiledrv \
48 graphics/win16drv \
49 if1632 \
50 include \
51 library \
52 libtest \
53 loader \
54 loader/dos \
55 loader/ne \
56 memory \
57 misc \
58 miscemu \
59 msdos \
60 objects \
61 ole \
62 programs \
63 relay32 \
64 resources \
65 scheduler \
66 server \
67 tools \
68 unicode \
69 win32 \
70 windows
Alexandre Julliard641ee761997-08-04 16:34:36 +000071
72# Sub-directories to run make install into
Alexandre Julliard2f158c22000-06-14 21:45:38 +000073INSTALLSUBDIRS = \
74 debugger \
75 dlls \
76 documentation \
77 include \
78 server \
79 tools
Patrik Stridvalla9be64e1999-07-31 17:39:44 +000080
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +000081LIBOBJS = \
Alexandre Julliardff8331e1995-09-18 11:19:54 +000082 controls/controls.o \
Joseph Pranevich791cd6a1998-12-02 19:58:08 +000083 console/console.o \
Juergen Schmiedf7b0de31999-01-03 12:48:29 +000084 dlls/advapi32/advapi32.o \
Marcus Meissner51505b11998-11-01 14:00:21 +000085 dlls/ntdll/ntdll.o \
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +000086 files/files.o \
Alexandre Julliard0e270f41996-08-24 18:26:35 +000087 graphics/graphics.o \
Huw D M Davies3a24f3f1999-05-02 10:15:16 +000088 graphics/enhmetafiledrv/enhmetafiledrv.o \
Alexandre Julliardbf9130a1996-10-13 17:45:47 +000089 graphics/metafiledrv/metafiledrv.o \
Ulrich Weigand4b32fd01999-07-15 14:51:40 +000090 graphics/win16drv/win16drv.o \
91 if1632/if1632.o \
Alexandre Julliardff8331e1995-09-18 11:19:54 +000092 loader/loader.o \
Alexandre Julliard46ea8b31998-05-03 19:01:20 +000093 loader/ne/ne.o \
Alexandre Julliard767e6f61998-08-09 12:47:43 +000094 loader/dos/dos.o \
Alexandre Julliard2ace16a1996-04-28 15:09:19 +000095 memory/memory.o \
Alexandre Julliardff8331e1995-09-18 11:19:54 +000096 misc/misc.o \
Alexandre Julliard9ea19e51997-01-01 17:29:55 +000097 msdos/msdos.o \
Alexandre Julliardff8331e1995-09-18 11:19:54 +000098 objects/objects.o \
Alexandre Julliarde658d821997-11-30 17:45:40 +000099 ole/ole.o \
Alexandre Julliard60ce85c1998-02-01 18:33:27 +0000100 relay32/relay32.o \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000101 resources/resources.o \
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000102 scheduler/scheduler.o \
Alexandre Julliardfb270dd2000-06-09 05:27:21 +0000103 unicode/unicode.o \
Alexandre Julliardaf0bae51995-10-03 17:06:08 +0000104 win32/win32.o \
Alexandre Julliard77d5ebb2000-03-25 14:03:50 +0000105 windows/windows.o
Patrik Stridvallea584721998-11-01 16:22:07 +0000106
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000107EMUOBJS = \
Alexandre Julliard60ce85c1998-02-01 18:33:27 +0000108 miscemu/miscemu.o
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000109
Alexandre Julliard318f4ce2000-01-31 05:02:49 +0000110DLLOBJS = $(DLLS:%=dlls/lib%.@LIBEXT@)
111
Alexandre Julliard77d5ebb2000-03-25 14:03:50 +0000112EXTRA_OBJS = $(LIBOBJS)
Uwe Bonnes2a4707a1998-10-11 14:57:08 +0000113
Alexandre Julliard2f158c22000-06-14 21:45:38 +0000114all: Make.rules $(PROGRAMS) $(LIBPROGRAMS) wine
Pavel Roskin74197cb1999-07-31 19:25:22 +0000115 @echo "Wine build complete."
Alexandre Julliard808cb041995-08-17 17:11:36 +0000116
Patrik Stridvalla9be64e1999-07-31 17:39:44 +0000117LIBLINTS = $(LIBOBJS:.o=.ln)
Patrik Stridvalla9be64e1999-07-31 17:39:44 +0000118EMULINTS = $(EMUOBJS:.o=.ln)
119
120lint:: llib-lwine.ln $(EMULINTS)
121 $(LINT) $(ALLLINTFLAGS) -L. -lwine $(EMULINTS)
122
Patrik Stridvall385dc181999-09-29 10:24:19 +0000123WINAPI_CHECK_EXTRA_FLAGS = --global
124
Alexandre Julliard641ee761997-08-04 16:34:36 +0000125@MAKE_RULES@
126
Marcus Meissnerca004e51999-01-03 12:26:22 +0000127Make.rules: Make.rules.in configure
128 @echo $? is newer than 'Make.rules', please rerun ./configure!
129 @exit 1
130
Alexandre Julliarde1e75372000-04-24 17:17:49 +0000131wine: lib$(MODULE).$(LIBEXT) $(DLLDIR) $(EMUOBJS)
132 $(CC) -o wine $(EMUOBJS) $(DLL_LINK) $(LIBS)
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000133
Alexandre Julliard77d5ebb2000-03-25 14:03:50 +0000134llib-lwine.ln : $(LIBLINTS)
135 $(LINT) $(ALLLINTFLAGS) -owine $(LIBLINTS)
Patrik Stridvalla9be64e1999-07-31 17:39:44 +0000136
Alexandre Julliardd0edc5f2000-03-04 22:31:27 +0000137install_so: lib$(MODULE).so.$(SOVERSION)
138 [ -d $(libdir) ] || $(MKDIR) $(libdir)
139 $(INSTALL_PROGRAM) lib$(MODULE).so.$(SOVERSION) $(libdir)/lib$(MODULE).so.$(SOVERSION)
140 cd $(libdir) && $(RM) lib$(MODULE).so && $(LN_S) lib$(MODULE).so.$(SOVERSION) lib$(MODULE).so
141
142install_a: lib$(MODULE).a
143 [ -d $(libdir) ] || $(MKDIR) $(libdir)
144 $(INSTALL_DATA) lib$(MODULE).a $(libdir)/lib$(MODULE).a
145
Alexandre Julliard2f158c22000-06-14 21:45:38 +0000146install:: all $(LIBEXT:%=install_%) $(INSTALLSUBDIRS:%=%/__install__)
Alexandre Julliard318f4ce2000-01-31 05:02:49 +0000147 [ -d $(bindir) ] || $(MKDIR) $(bindir)
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000148 $(INSTALL_PROGRAM) wine $(bindir)/wine
Alexandre Julliard0adad952000-01-26 01:45:58 +0000149 $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
Alexandre Julliard2f158c22000-06-14 21:45:38 +0000150 -$(LDCONFIG)
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000151
Alexandre Julliard2f158c22000-06-14 21:45:38 +0000152uninstall:: $(INSTALLSUBDIRS:%=%/__uninstall__)
Alexandre Julliarde1e75372000-04-24 17:17:49 +0000153 cd $(libdir) && $(RM) libwine.a libwine.so libwine.so.$(SOVERSION)
Alexandre Julliard2f158c22000-06-14 21:45:38 +0000154 cd $(bindir) && $(RM) wine dosmod
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000155
Alexandre Julliardd0edc5f2000-03-04 22:31:27 +0000156lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in Make.rules.in
157 $(LDSHARED) $(OBJS) -o $@
158
159lib$(MODULE).so: lib$(MODULE).so.$(SOVERSION)
160 $(RM) $@ && $(LN_S) lib$(MODULE).so.$(SOVERSION) $@
161
162lib$(MODULE).a: $(OBJS) Makefile.in Make.rules.in
163 $(RM) $@
164 $(AR) $@ $(OBJS)
165 $(RANLIB) $@
166
Alexandre Julliard2f158c22000-06-14 21:45:38 +0000167$(EMUOBJS) $(LIBOBJS) $(DLLOBJS) $(PROGRAMS) $(LIBPROGRAMS): dummy
Alexandre Julliard0adad952000-01-26 01:45:58 +0000168 @cd `dirname $@` && $(MAKE) `basename $@`
Marcus Meissnera4d03191999-07-24 12:12:43 +0000169
Alexandre Julliard2f158c22000-06-14 21:45:38 +0000170$(EMUOBJS) $(LIBOBJS) $(DLLOBJS) $(PROGRAMS) $(DLLDIR): tools
Alexandre Julliarde1e75372000-04-24 17:17:49 +0000171
Alexandre Julliard2f158c22000-06-14 21:45:38 +0000172$(LIBPROGRAMS): tools dlls lib$(MODULE).$(LIBEXT)
Eric Poueche5efa0c2000-04-13 19:31:58 +0000173
Alexandre Julliard77d5ebb2000-03-25 14:03:50 +0000174$(LIBLINTS) $(EMULINTS): dummy
175 @cd `dirname $@` && $(MAKE) lint
Patrik Stridvalla9be64e1999-07-31 17:39:44 +0000176
Alexandre Julliard2f158c22000-06-14 21:45:38 +0000177checklink::
178 $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -lwine $(LIBS) && $(RM) checklink
179
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000180install_programs: dummy
Alexandre Julliard0adad952000-01-26 01:45:58 +0000181 @cd programs && $(MAKE) install
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000182
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000183uninstall_programs: dummy
Alexandre Julliard0adad952000-01-26 01:45:58 +0000184 @cd programs && $(MAKE) uninstall
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000185
Alexandre Julliard318f4ce2000-01-31 05:02:49 +0000186checklink::
187 @cd dlls && $(MAKE) checklink
188
Alexandre Julliard641ee761997-08-04 16:34:36 +0000189TAGS etags:
190 etags `find $(TOPSRCDIR) -name '*.[chS]' -print | grep -v dbgmain`
191
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000192manpages:
193 -$(MKDIR) $(TOPOBJDIR)/documentation/man3w
Alexandre Julliard2f158c22000-06-14 21:45:38 +0000194 for i in $(SUBDIRS); do (cd $$i && $(MAKE) man); done
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000195
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000196htmlpages:
197 -$(MKDIR) $(TOPOBJDIR)/documentation/html
Alexandre Julliard2f158c22000-06-14 21:45:38 +0000198 for i in $(SUBDIRS); do (cd $$i && $(MAKE) html); done
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000199
Alexandre Julliard641ee761997-08-04 16:34:36 +0000200clean::
Alexandre Julliarde1e75372000-04-24 17:17:49 +0000201 $(RM) wine libwine.so.1.0 TAGS
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000202
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000203distclean: clean
Alexandre Julliardd0edc5f2000-03-04 22:31:27 +0000204 $(RM) config.* Make.rules dlls/Makedll.rules include/config.h documentation/wine.man documentation/wine.conf.man
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000205 $(RM) `find . \( -name Makefile -o -size 0 \) -print`
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000206
Marcus Meissnerab554421999-01-23 13:59:51 +0000207# We depend on configure above for checks, so we better don't use this rule.
208#configure: configure.in
209# autoconf
Alexandre Julliard8cc3a5e1996-08-11 15:49:51 +0000210
211include/config.h.in: configure.in include/acconfig.h
212 autoheader -l include
213
Alexandre Julliard641ee761997-08-04 16:34:36 +0000214### Dependencies: