blob: 29bf3045c450ea8f2ccb4ce7b534dfee360a97e5 [file] [log] [blame]
Alexandre Julliarde2991ea1995-07-29 13:09:43 +00001# This Makefile understands the following targets:
2#
3# all (default): build wine
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +00004# lib: build libwine
Alexandre Julliarde2991ea1995-07-29 13:09:43 +00005# clean: remove all intermediate files
6# distclean: also remove all files created by configure
Alexandre Julliard641ee761997-08-04 16:34:36 +00007# install: install everything
Alexandre Julliard85ed45e1998-08-22 19:03:56 +00008# uninstall: uninstall everything
Alexandre Julliarde2991ea1995-07-29 13:09:43 +00009# depend: create the dependencies
Alexandre Julliard641ee761997-08-04 16:34:36 +000010# etags: create a TAGS file for Emacs.
Alexandre Julliard44ed71f1997-12-21 19:17:50 +000011# manpages: compile manpages for Wine API
Alexandre Julliarde2991ea1995-07-29 13:09:43 +000012#
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000013
14# Main target to build
15
Alexandre Julliardff8331e1995-09-18 11:19:54 +000016MAIN_TARGET = @MAIN_TARGET@
Alexandre Julliarde2991ea1995-07-29 13:09:43 +000017
Alexandre Julliard641ee761997-08-04 16:34:36 +000018# Directories
19
20TOPSRCDIR = @top_srcdir@
21TOPOBJDIR = .
22SRCDIR = @srcdir@
23VPATH = @srcdir@
24MODULE = none
25
Alexandre Julliard609f6711999-07-25 11:28:39 +000026TOOLSUBDIRS = \
Alexandre Julliard44ed71f1997-12-21 19:17:50 +000027 tools \
Alexandre Julliard609f6711999-07-25 11:28:39 +000028 tools/wrc
29
30LIBSUBDIRS = \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000031 controls \
Joseph Pranevich791cd6a1998-12-02 19:58:08 +000032 console \
Juergen Schmiedf7b0de31999-01-03 12:48:29 +000033 dlls/advapi32 \
Marcus Meissnerb3d1a221999-03-13 18:07:44 +000034 dlls/avifil32 \
Alexandre Julliarda0d77311998-09-13 16:32:00 +000035 dlls/comctl32 \
Klaas van Gendc9127491999-02-28 20:05:11 +000036 dlls/commdlg \
Patrik Stridvall8295c861998-10-11 17:09:05 +000037 dlls/imagehlp \
38 dlls/msacm \
39 dlls/msacm32 \
Marcus Meissner51505b11998-11-01 14:00:21 +000040 dlls/ntdll \
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000041 dlls/psapi \
Marcus Meissner30ef8771998-12-11 13:26:26 +000042 dlls/rasapi32 \
Alexandre Julliard85ed45e1998-08-22 19:03:56 +000043 dlls/shell32 \
Andreas Mohr5aa96c11999-03-14 12:34:25 +000044 dlls/tapi32 \
Ulrich Weigandd43a46a1999-01-31 10:11:04 +000045 dlls/ver \
46 dlls/version \
Ulrich Weigand4b32fd01999-07-15 14:51:40 +000047 dlls/win87em \
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000048 dlls/winaspi \
Huw D M Daviese39b6761999-05-17 16:20:51 +000049 dlls/winspool \
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000050 dlls/wnaspi32 \
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +000051 files \
Alexandre Julliard0e270f41996-08-24 18:26:35 +000052 graphics \
Huw D M Davies3a24f3f1999-05-02 10:15:16 +000053 graphics/enhmetafiledrv \
Alexandre Julliardbf9130a1996-10-13 17:45:47 +000054 graphics/metafiledrv \
Huw D M Davies96508641998-11-22 12:55:24 +000055 graphics/psdrv \
Patrik Stridvall36bbd621999-02-04 10:10:59 +000056 graphics/ttydrv \
Ulrich Weigand4b32fd01999-07-15 14:51:40 +000057 graphics/win16drv \
58 if1632 \
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +000059 library \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000060 loader \
Alexandre Julliard46ea8b31998-05-03 19:01:20 +000061 loader/ne \
Alexandre Julliard767e6f61998-08-09 12:47:43 +000062 loader/dos \
Alexandre Julliard2ace16a1996-04-28 15:09:19 +000063 memory \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000064 misc \
Alexandre Julliard9ea19e51997-01-01 17:29:55 +000065 msdos \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000066 multimedia \
67 objects \
Alexandre Julliarde658d821997-11-30 17:45:40 +000068 ole \
Alexandre Julliard60ce85c1998-02-01 18:33:27 +000069 relay32 \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000070 resources \
Alexandre Julliard9ea19e51997-01-01 17:29:55 +000071 scheduler \
Alexandre Julliard642d3131998-07-12 19:29:36 +000072 server \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000073 win32 \
Patrik Stridvallf638aef1998-12-07 09:36:13 +000074 windows \
75 windows/ttydrv
Alexandre Julliardff8331e1995-09-18 11:19:54 +000076
Patrik Stridvallea584721998-11-01 16:22:07 +000077X11SUBDIRS = \
78 graphics/x11drv \
79 tsx11 \
80 windows/x11drv
81
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000082EMUSUBDIRS = \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000083 debugger \
Alexandre Julliard60ce85c1998-02-01 18:33:27 +000084 miscemu
Alexandre Julliarde2991ea1995-07-29 13:09:43 +000085
Alexandre Julliard02ed4c21996-03-02 19:34:10 +000086PROGSUBDIRS = libtest programs
87
Alexandre Julliardd37eb361997-07-20 16:23:21 +000088DOCSUBDIRS = documentation
89
James Juranc70dc831999-02-13 12:18:33 +000090INCSUBDIRS = include
91
92# Sub-directories to run make into
93BUILDSUBDIRS = \
Alexandre Julliard609f6711999-07-25 11:28:39 +000094 $(TOOLSUBDIRS) \
Alexandre Julliardd37eb361997-07-20 16:23:21 +000095 $(LIBSUBDIRS) \
Patrik Stridvallea584721998-11-01 16:22:07 +000096 $(X11SUBDIRS) \
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +000097 $(EMUSUBDIRS) \
Alexandre Julliardd37eb361997-07-20 16:23:21 +000098 $(PROGSUBDIRS) \
99 $(DOCSUBDIRS)
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000100
Alexandre Julliard641ee761997-08-04 16:34:36 +0000101# Sub-directories to run make depend into
Patrik Stridvallea584721998-11-01 16:22:07 +0000102DEPENDSUBDIRS = $(LIBSUBDIRS) $(X11SUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
Alexandre Julliard641ee761997-08-04 16:34:36 +0000103
104# Sub-directories to run make install into
James Juranc70dc831999-02-13 12:18:33 +0000105INSTALLSUBDIRS = $(DOCSUBDIRS) $(INCSUBDIRS)
Alexandre Julliard641ee761997-08-04 16:34:36 +0000106
Patrik Stridvalla9be64e1999-07-31 17:39:44 +0000107# Sub-directories to run make lint into
108LINTSUBDIRS = $(LIBSUBDIRS) $(X11SUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
109
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000110LIBOBJS = \
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000111 controls/controls.o \
Joseph Pranevich791cd6a1998-12-02 19:58:08 +0000112 console/console.o \
Juergen Schmiedf7b0de31999-01-03 12:48:29 +0000113 dlls/advapi32/advapi32.o \
Marcus Meissnerb3d1a221999-03-13 18:07:44 +0000114 dlls/avifil32/avifil32.o \
Alexandre Julliarda0d77311998-09-13 16:32:00 +0000115 dlls/comctl32/comctl32.o \
Klaas van Gendc9127491999-02-28 20:05:11 +0000116 dlls/commdlg/commdlg.o \
Patrik Stridvall8295c861998-10-11 17:09:05 +0000117 dlls/imagehlp/imagehlp.o \
118 dlls/msacm/msacm.o \
119 dlls/msacm32/msacm32.o \
Marcus Meissner51505b11998-11-01 14:00:21 +0000120 dlls/ntdll/ntdll.o \
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000121 dlls/psapi/psapi.o \
Marcus Meissner30ef8771998-12-11 13:26:26 +0000122 dlls/rasapi32/rasapi32.o \
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000123 dlls/shell32/shell32.o \
Andreas Mohr5aa96c11999-03-14 12:34:25 +0000124 dlls/tapi32/tapi32.o \
Ulrich Weigandd43a46a1999-01-31 10:11:04 +0000125 dlls/ver/ver.o \
126 dlls/version/version.o \
Ulrich Weigand4b32fd01999-07-15 14:51:40 +0000127 dlls/win87em/win87em.o \
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000128 dlls/winaspi/winaspi.o \
Huw D M Daviese39b6761999-05-17 16:20:51 +0000129 dlls/winspool/winspool.o \
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000130 dlls/wnaspi32/wnaspi32.o \
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +0000131 files/files.o \
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000132 graphics/graphics.o \
Huw D M Davies3a24f3f1999-05-02 10:15:16 +0000133 graphics/enhmetafiledrv/enhmetafiledrv.o \
Alexandre Julliardbf9130a1996-10-13 17:45:47 +0000134 graphics/metafiledrv/metafiledrv.o \
Huw D M Davies96508641998-11-22 12:55:24 +0000135 graphics/psdrv/psdrv.o \
Patrik Stridvall36bbd621999-02-04 10:10:59 +0000136 graphics/ttydrv/ttydrv.o \
Ulrich Weigand4b32fd01999-07-15 14:51:40 +0000137 graphics/win16drv/win16drv.o \
138 if1632/if1632.o \
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000139 loader/loader.o \
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000140 loader/ne/ne.o \
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000141 loader/dos/dos.o \
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000142 memory/memory.o \
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000143 misc/misc.o \
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000144 msdos/msdos.o \
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000145 multimedia/multimedia.o \
146 objects/objects.o \
Alexandre Julliarde658d821997-11-30 17:45:40 +0000147 ole/ole.o \
Alexandre Julliard60ce85c1998-02-01 18:33:27 +0000148 relay32/relay32.o \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000149 resources/resources.o \
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000150 scheduler/scheduler.o \
Alexandre Julliard642d3131998-07-12 19:29:36 +0000151 server/server.o \
Alexandre Julliardaf0bae51995-10-03 17:06:08 +0000152 win32/win32.o \
Patrik Stridvallf638aef1998-12-07 09:36:13 +0000153 windows/windows.o \
154 windows/ttydrv/ttydrv.o
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000155
Patrik Stridvallea584721998-11-01 16:22:07 +0000156X11OBJS = \
157 graphics/x11drv/x11drv.o \
158 tsx11/tsx11.o \
159 windows/x11drv/x11drv.o
160
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000161EMUOBJS = \
162 debugger/debugger.o \
Alexandre Julliard60ce85c1998-02-01 18:33:27 +0000163 miscemu/miscemu.o
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000164
Alexandre Julliard642d3131998-07-12 19:29:36 +0000165LIB_TARGET = @LIB_TARGET@
166
Uwe Bonnes2a4707a1998-10-11 14:57:08 +0000167ALT_LINK = @ALT_LINK@
168
Marcus Meissnerca004e51999-01-03 12:26:22 +0000169all: Makefile Make.rules $(MAIN_TARGET)
Alexandre Julliard808cb041995-08-17 17:11:36 +0000170
Patrik Stridvalla9be64e1999-07-31 17:39:44 +0000171LIBLINTS = $(LIBOBJS:.o=.ln)
172X11LINTS = $(X11OBJS:.o=.ln)
173EMULINTS = $(EMUOBJS:.o=.ln)
174
175lint:: llib-lwine.ln $(EMULINTS)
176 $(LINT) $(ALLLINTFLAGS) -L. -lwine $(EMULINTS)
177
Alexandre Julliard641ee761997-08-04 16:34:36 +0000178@MAKE_RULES@
179
Marcus Meissnerca004e51999-01-03 12:26:22 +0000180Make.rules: Make.rules.in configure
181 @echo $? is newer than 'Make.rules', please rerun ./configure!
182 @exit 1
183
Alexandre Julliard641ee761997-08-04 16:34:36 +0000184install:: install_$(MAIN_TARGET)
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000185
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000186uninstall:: uninstall_$(MAIN_TARGET)
187
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000188emu: wine
189
Patrik Stridvallea584721998-11-01 16:22:07 +0000190lib: $(LIBSUBDIRS) $(X11SUBDIRS) $(LIB_TARGET)
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000191
Marcus Meissnera6f7cee1999-07-25 11:30:12 +0000192wine wine.sym: $(LIB_TARGET) $(EMUOBJS) $(X11OBJS) $(LIBOBJS) dummy
Todd Vierling8beb15a1998-12-18 17:30:52 +0000193 $(CC) -o wine $(EMUOBJS) $(ALT_LINK) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
Alexandre Julliard902da691995-11-05 14:39:02 +0000194 nm -n wine | grep -v _compiled >wine.sym
Douglas Ridgway8b21f281998-11-01 15:14:39 +0000195 @echo "Wine build complete."
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000196
Marcus Meissner4d088fa1999-07-27 16:11:17 +0000197libwine.a: $(LIBOBJS) $(X11OBJS)
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000198 $(RM) $@
Patrik Stridvallea584721998-11-01 16:22:07 +0000199 $(AR) $@ $(LIBOBJS) $(X11OBJS)
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000200 $(RANLIB) $@
Alexandre Julliard808cb041995-08-17 17:11:36 +0000201
Patrik Stridvalla9be64e1999-07-31 17:39:44 +0000202llib-lwine.ln : $(LIBLINTS) $(X11LINTS)
203 $(LINT) $(ALLLINTFLAGS) -owine $(LIBLINTS) $(X11LINTS)
204
Marcus Meissner4d088fa1999-07-27 16:11:17 +0000205libwine.so.1.0: $(LIBOBJS) $(X11OBJS)
Todd Vierling4b992b01998-12-15 15:26:27 +0000206 $(LDSHARED) -o$@ $(LIBOBJS) $(X11OBJS) $(LDOPTIONS)
Alexandre Julliard638f1691999-01-17 16:32:32 +0000207 ln -sf $@ libwine.so
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000208
Alexandre Julliard03468f71998-02-15 19:40:49 +0000209install_emu: install_lib
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000210 [ -d $(bindir) ] || $(MKDIR) $(bindir)
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000211 $(INSTALL_PROGRAM) wine $(bindir)/wine
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000212 $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000213
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000214uninstall_emu: uninstall_lib
215 $(RM) $(bindir)/wine $(bindir)/dosmod
216
James Juranc70dc831999-02-13 12:18:33 +0000217install_lib: dummy
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000218 [ -d $(libdir) ] || $(MKDIR) $(libdir)
Zygo Blaxelld6cab501999-02-20 16:07:49 +0000219 if [ -f wine.sym ]; then $(INSTALL_DATA) wine.sym $(libdir)/wine.sym; fi
James Juran16e278c1999-06-26 10:15:24 +0000220 if [ $(LIB_TARGET) ]; then \
221 $(INSTALL_DATA) $(LIB_TARGET) $(libdir); \
222 if [ $(LIB_TARGET) = libwine.so.1.0 ]; then $(LDCONFIG); fi \
223 fi
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000224
James Juranc70dc831999-02-13 12:18:33 +0000225uninstall_lib: dummy
James Juranb199b191999-05-08 10:43:13 +0000226 cd $(libdir); $(RM) $(LIB_TARGET) libwine.a libwine.so wine.sym
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000227
Marcus Meissner4d088fa1999-07-27 16:11:17 +0000228$(X11OBJS) $(EMUOBJS) $(LIBOBJS): $(TOOLSUBDIRS) dummy
Marcus Meissnera4d03191999-07-24 12:12:43 +0000229 @cd `dirname $@`; $(SUBMAKE)
230
James Juranc70dc831999-02-13 12:18:33 +0000231$(BUILDSUBDIRS): dummy
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000232 @cd $@; $(SUBMAKE)
Alexandre Julliard808cb041995-08-17 17:11:36 +0000233
Patrik Stridvalla9be64e1999-07-31 17:39:44 +0000234$(LIBLINTS) $(X11LINTS) $(EMULINTS): dummy
235 @echo $@ | sed 's%\(.*\)\/[^\/]*%cd \1 \&\& make lint%' | sh
236
237
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000238install_programs: dummy
239 @cd programs; $(SUBMAKE) install
240
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000241uninstall_programs: dummy
242 @cd programs; $(SUBMAKE) uninstall
243
Alexandre Julliard641ee761997-08-04 16:34:36 +0000244install::
245 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) install) || exit 1; done
Alexandre Julliard808cb041995-08-17 17:11:36 +0000246
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000247uninstall::
248 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit 1; done
249
Alexandre Julliard641ee761997-08-04 16:34:36 +0000250depend:: dummy
251 for i in $(DEPENDSUBDIRS); do (cd $$i && $(MAKE) depend) || exit 1; done
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000252
Alexandre Julliard641ee761997-08-04 16:34:36 +0000253TAGS etags:
254 etags `find $(TOPSRCDIR) -name '*.[chS]' -print | grep -v dbgmain`
255
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000256manpages:
257 -$(MKDIR) $(TOPOBJDIR)/documentation/man3w
258 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) man); done
259
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000260htmlpages:
261 -$(MKDIR) $(TOPOBJDIR)/documentation/html
262 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) html); done
263
Alexandre Julliard641ee761997-08-04 16:34:36 +0000264clean::
James Juranc70dc831999-02-13 12:18:33 +0000265 for i in $(BUILDSUBDIRS); do (cd $$i; $(MAKE) clean) || exit 1; done
Patrik Stridvall2d0bb2a1999-07-04 15:56:03 +0000266 for i in include include/bitmaps include/wine; do (cd $$i; $(RM) *.o \#*\# .#* *~ *% *.bak *.orig *.rej *.flc); done
Alexandre Julliard638f1691999-01-17 16:32:32 +0000267 $(RM) wine wine.sym libwine.a libwine.so.1.0 libwine.so TAGS .#*
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000268
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000269distclean: clean
Alexander V. Lukyanov0bc384f1999-06-18 16:58:06 +0000270 $(RM) config.* Make.rules include/config.h documentation/wine.man
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000271 $(RM) `find . \( -name Makefile -o -size 0 \) -print`
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000272
Marcus Meissnerab554421999-01-23 13:59:51 +0000273# We depend on configure above for checks, so we better don't use this rule.
274#configure: configure.in
275# autoconf
Alexandre Julliard8cc3a5e1996-08-11 15:49:51 +0000276
277include/config.h.in: configure.in include/acconfig.h
278 autoheader -l include
279
Alexandre Julliard641ee761997-08-04 16:34:36 +0000280### Dependencies: