blob: 9f7a9356c63f232bfd52e20ddde5f8ebe5186c6b [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 Julliarda0b2b1d1997-11-16 17:38:29 +000026LIBSUBDIRS = \
Alexandre Julliard44ed71f1997-12-21 19:17:50 +000027 tools \
Alexandre Julliarda845b881998-06-01 10:44:35 +000028 tools/wrc \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000029 controls \
Joseph Pranevich791cd6a1998-12-02 19:58:08 +000030 console \
Juergen Schmiedf7b0de31999-01-03 12:48:29 +000031 dlls/advapi32 \
Marcus Meissnerb3d1a221999-03-13 18:07:44 +000032 dlls/avifil32 \
Alexandre Julliarda0d77311998-09-13 16:32:00 +000033 dlls/comctl32 \
Klaas van Gendc9127491999-02-28 20:05:11 +000034 dlls/commdlg \
Patrik Stridvall8295c861998-10-11 17:09:05 +000035 dlls/imagehlp \
36 dlls/msacm \
37 dlls/msacm32 \
Marcus Meissner51505b11998-11-01 14:00:21 +000038 dlls/ntdll \
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000039 dlls/psapi \
Marcus Meissner30ef8771998-12-11 13:26:26 +000040 dlls/rasapi32 \
Alexandre Julliard85ed45e1998-08-22 19:03:56 +000041 dlls/shell32 \
Andreas Mohr5aa96c11999-03-14 12:34:25 +000042 dlls/tapi32 \
Ulrich Weigandd43a46a1999-01-31 10:11:04 +000043 dlls/ver \
44 dlls/version \
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000045 dlls/winaspi \
46 dlls/wnaspi32 \
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +000047 files \
Alexandre Julliard0e270f41996-08-24 18:26:35 +000048 graphics \
Huw D M Davies3a24f3f1999-05-02 10:15:16 +000049 graphics/enhmetafiledrv \
Alexandre Julliardbf9130a1996-10-13 17:45:47 +000050 graphics/metafiledrv \
Huw D M Davies96508641998-11-22 12:55:24 +000051 graphics/psdrv \
Patrik Stridvall36bbd621999-02-04 10:10:59 +000052 graphics/ttydrv \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000053 ipc \
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +000054 library \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000055 loader \
Alexandre Julliard46ea8b31998-05-03 19:01:20 +000056 loader/ne \
Alexandre Julliard767e6f61998-08-09 12:47:43 +000057 loader/dos \
Alexandre Julliard2ace16a1996-04-28 15:09:19 +000058 memory \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000059 misc \
Alexandre Julliard9ea19e51997-01-01 17:29:55 +000060 msdos \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000061 multimedia \
62 objects \
Alexandre Julliarde658d821997-11-30 17:45:40 +000063 ole \
Alexandre Julliard60ce85c1998-02-01 18:33:27 +000064 relay32 \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000065 resources \
Alexandre Julliard9ea19e51997-01-01 17:29:55 +000066 scheduler \
Alexandre Julliard642d3131998-07-12 19:29:36 +000067 server \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000068 win32 \
Patrik Stridvallf638aef1998-12-07 09:36:13 +000069 windows \
70 windows/ttydrv
Alexandre Julliardff8331e1995-09-18 11:19:54 +000071
Patrik Stridvallea584721998-11-01 16:22:07 +000072X11SUBDIRS = \
73 graphics/x11drv \
74 tsx11 \
75 windows/x11drv
76
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000077EMUSUBDIRS = \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000078 debugger \
Alexandre Julliard0e270f41996-08-24 18:26:35 +000079 graphics/win16drv \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +000080 if1632 \
Alexandre Julliard60ce85c1998-02-01 18:33:27 +000081 miscemu
Alexandre Julliarde2991ea1995-07-29 13:09:43 +000082
Alexandre Julliard02ed4c21996-03-02 19:34:10 +000083PROGSUBDIRS = libtest programs
84
Alexandre Julliardd37eb361997-07-20 16:23:21 +000085DOCSUBDIRS = documentation
86
James Juranc70dc831999-02-13 12:18:33 +000087INCSUBDIRS = include
88
89# Sub-directories to run make into
90BUILDSUBDIRS = \
Alexandre Julliardd37eb361997-07-20 16:23:21 +000091 $(LIBSUBDIRS) \
Patrik Stridvallea584721998-11-01 16:22:07 +000092 $(X11SUBDIRS) \
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +000093 $(EMUSUBDIRS) \
Alexandre Julliardd37eb361997-07-20 16:23:21 +000094 $(PROGSUBDIRS) \
95 $(DOCSUBDIRS)
Alexandre Julliardff8331e1995-09-18 11:19:54 +000096
Alexandre Julliard641ee761997-08-04 16:34:36 +000097# Sub-directories to run make depend into
Patrik Stridvallea584721998-11-01 16:22:07 +000098DEPENDSUBDIRS = $(LIBSUBDIRS) $(X11SUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
Alexandre Julliard641ee761997-08-04 16:34:36 +000099
100# Sub-directories to run make install into
James Juranc70dc831999-02-13 12:18:33 +0000101INSTALLSUBDIRS = $(DOCSUBDIRS) $(INCSUBDIRS)
Alexandre Julliard641ee761997-08-04 16:34:36 +0000102
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000103LIBOBJS = \
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000104 controls/controls.o \
Joseph Pranevich791cd6a1998-12-02 19:58:08 +0000105 console/console.o \
Juergen Schmiedf7b0de31999-01-03 12:48:29 +0000106 dlls/advapi32/advapi32.o \
Marcus Meissnerb3d1a221999-03-13 18:07:44 +0000107 dlls/avifil32/avifil32.o \
Alexandre Julliarda0d77311998-09-13 16:32:00 +0000108 dlls/comctl32/comctl32.o \
Klaas van Gendc9127491999-02-28 20:05:11 +0000109 dlls/commdlg/commdlg.o \
Patrik Stridvall8295c861998-10-11 17:09:05 +0000110 dlls/imagehlp/imagehlp.o \
111 dlls/msacm/msacm.o \
112 dlls/msacm32/msacm32.o \
Marcus Meissner51505b11998-11-01 14:00:21 +0000113 dlls/ntdll/ntdll.o \
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000114 dlls/psapi/psapi.o \
Marcus Meissner30ef8771998-12-11 13:26:26 +0000115 dlls/rasapi32/rasapi32.o \
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000116 dlls/shell32/shell32.o \
Andreas Mohr5aa96c11999-03-14 12:34:25 +0000117 dlls/tapi32/tapi32.o \
Ulrich Weigandd43a46a1999-01-31 10:11:04 +0000118 dlls/ver/ver.o \
119 dlls/version/version.o \
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000120 dlls/winaspi/winaspi.o \
121 dlls/wnaspi32/wnaspi32.o \
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +0000122 files/files.o \
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000123 graphics/graphics.o \
Huw D M Davies3a24f3f1999-05-02 10:15:16 +0000124 graphics/enhmetafiledrv/enhmetafiledrv.o \
Alexandre Julliardbf9130a1996-10-13 17:45:47 +0000125 graphics/metafiledrv/metafiledrv.o \
Huw D M Davies96508641998-11-22 12:55:24 +0000126 graphics/psdrv/psdrv.o \
Patrik Stridvall36bbd621999-02-04 10:10:59 +0000127 graphics/ttydrv/ttydrv.o \
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000128 ipc/ipc.o \
129 loader/loader.o \
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000130 loader/ne/ne.o \
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000131 loader/dos/dos.o \
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000132 memory/memory.o \
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000133 misc/misc.o \
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000134 msdos/msdos.o \
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000135 multimedia/multimedia.o \
136 objects/objects.o \
Alexandre Julliarde658d821997-11-30 17:45:40 +0000137 ole/ole.o \
Alexandre Julliard60ce85c1998-02-01 18:33:27 +0000138 relay32/relay32.o \
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000139 resources/resources.o \
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000140 scheduler/scheduler.o \
Alexandre Julliard642d3131998-07-12 19:29:36 +0000141 server/server.o \
Alexandre Julliardaf0bae51995-10-03 17:06:08 +0000142 win32/win32.o \
Patrik Stridvallf638aef1998-12-07 09:36:13 +0000143 windows/windows.o \
144 windows/ttydrv/ttydrv.o
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000145
Patrik Stridvallea584721998-11-01 16:22:07 +0000146X11OBJS = \
147 graphics/x11drv/x11drv.o \
148 tsx11/tsx11.o \
149 windows/x11drv/x11drv.o
150
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000151EMUOBJS = \
152 debugger/debugger.o \
Alexandre Julliard0e270f41996-08-24 18:26:35 +0000153 graphics/win16drv/win16drv.o \
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000154 if1632/if1632.o \
Alexandre Julliard60ce85c1998-02-01 18:33:27 +0000155 miscemu/miscemu.o
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000156
Alexandre Julliard642d3131998-07-12 19:29:36 +0000157LIB_TARGET = @LIB_TARGET@
158
Uwe Bonnes2a4707a1998-10-11 14:57:08 +0000159ALT_LINK = @ALT_LINK@
160
Marcus Meissnerca004e51999-01-03 12:26:22 +0000161all: Makefile Make.rules $(MAIN_TARGET)
Alexandre Julliard808cb041995-08-17 17:11:36 +0000162
Alexandre Julliard641ee761997-08-04 16:34:36 +0000163@MAKE_RULES@
164
Marcus Meissnerca004e51999-01-03 12:26:22 +0000165Make.rules: Make.rules.in configure
166 @echo $? is newer than 'Make.rules', please rerun ./configure!
167 @exit 1
168
Alexandre Julliard641ee761997-08-04 16:34:36 +0000169install:: install_$(MAIN_TARGET)
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000170
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000171uninstall:: uninstall_$(MAIN_TARGET)
172
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000173emu: wine
174
Patrik Stridvallea584721998-11-01 16:22:07 +0000175lib: $(LIBSUBDIRS) $(X11SUBDIRS) $(LIB_TARGET)
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000176
Patrik Stridvallea584721998-11-01 16:22:07 +0000177wine wine.sym: $(LIBSUBDIRS) $(X11SUBDIRS) $(LIB_TARGET) $(EMUSUBDIRS) dummy
Todd Vierling8beb15a1998-12-18 17:30:52 +0000178 $(CC) -o wine $(EMUOBJS) $(ALT_LINK) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
Alexandre Julliard902da691995-11-05 14:39:02 +0000179 nm -n wine | grep -v _compiled >wine.sym
Douglas Ridgway8b21f281998-11-01 15:14:39 +0000180 @echo "Wine build complete."
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000181
Patrik Stridvallea584721998-11-01 16:22:07 +0000182libwine.a: $(LIBOBJS) $(X11OBJS)
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000183 $(RM) $@
Patrik Stridvallea584721998-11-01 16:22:07 +0000184 $(AR) $@ $(LIBOBJS) $(X11OBJS)
Alexandre Julliardff8331e1995-09-18 11:19:54 +0000185 $(RANLIB) $@
Alexandre Julliard808cb041995-08-17 17:11:36 +0000186
Patrik Stridvallea584721998-11-01 16:22:07 +0000187libwine.so.1.0: $(LIBOBJS) $(X11OBJS)
Todd Vierling4b992b01998-12-15 15:26:27 +0000188 $(LDSHARED) -o$@ $(LIBOBJS) $(X11OBJS) $(LDOPTIONS)
Alexandre Julliard638f1691999-01-17 16:32:32 +0000189 ln -sf $@ libwine.so
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000190
Alexandre Julliard03468f71998-02-15 19:40:49 +0000191install_emu: install_lib
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000192 [ -d $(bindir) ] || $(MKDIR) $(bindir)
Alexandre Julliarda0b2b1d1997-11-16 17:38:29 +0000193 $(INSTALL_PROGRAM) wine $(bindir)/wine
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000194 $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000195
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000196uninstall_emu: uninstall_lib
197 $(RM) $(bindir)/wine $(bindir)/dosmod
198
James Juranc70dc831999-02-13 12:18:33 +0000199install_lib: dummy
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000200 [ -d $(libdir) ] || $(MKDIR) $(libdir)
James Juran50bb8791998-12-01 12:47:29 +0000201 if [ $(LIB_TARGET) ]; then $(INSTALL_DATA) $(LIB_TARGET) $(libdir); fi
Zygo Blaxelld6cab501999-02-20 16:07:49 +0000202 if [ -f wine.sym ]; then $(INSTALL_DATA) wine.sym $(libdir)/wine.sym; fi
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000203
James Juranc70dc831999-02-13 12:18:33 +0000204uninstall_lib: dummy
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000205 cd $(libdir); $(RM) $(LIB_TARGET)
Zygo Blaxelld6cab501999-02-20 16:07:49 +0000206 if [ -f $(libdir)/wine.sym ]; then $(RM) $(libdir)/wine.sym; fi
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000207
James Juranc70dc831999-02-13 12:18:33 +0000208$(BUILDSUBDIRS): dummy
Alexandre Julliardd7d4fdf1995-12-26 15:05:24 +0000209 @cd $@; $(SUBMAKE)
Alexandre Julliard808cb041995-08-17 17:11:36 +0000210
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000211install_programs: dummy
212 @cd programs; $(SUBMAKE) install
213
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000214uninstall_programs: dummy
215 @cd programs; $(SUBMAKE) uninstall
216
Alexandre Julliard641ee761997-08-04 16:34:36 +0000217install::
218 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) install) || exit 1; done
Alexandre Julliard808cb041995-08-17 17:11:36 +0000219
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000220uninstall::
221 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit 1; done
222
Alexandre Julliard641ee761997-08-04 16:34:36 +0000223depend:: dummy
224 for i in $(DEPENDSUBDIRS); do (cd $$i && $(MAKE) depend) || exit 1; done
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000225
Alexandre Julliard641ee761997-08-04 16:34:36 +0000226TAGS etags:
227 etags `find $(TOPSRCDIR) -name '*.[chS]' -print | grep -v dbgmain`
228
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000229manpages:
230 -$(MKDIR) $(TOPOBJDIR)/documentation/man3w
231 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) man); done
232
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000233htmlpages:
234 -$(MKDIR) $(TOPOBJDIR)/documentation/html
235 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) html); done
236
Alexandre Julliard641ee761997-08-04 16:34:36 +0000237clean::
James Juranc70dc831999-02-13 12:18:33 +0000238 for i in $(BUILDSUBDIRS); do (cd $$i; $(MAKE) clean) || exit 1; done
Joerg Mayer03b55291999-04-02 10:33:21 +0000239 for i in include include/bitmaps include/server include/wine; do (cd $$i; $(RM) *.o \#*\# .#* *~ *% *.bak *.orig *.rej *.flc); done
Alexandre Julliard638f1691999-01-17 16:32:32 +0000240 $(RM) wine wine.sym libwine.a libwine.so.1.0 libwine.so TAGS .#*
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000241
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000242distclean: clean
Alexandre Julliard18f92e71996-07-17 20:02:21 +0000243 $(RM) config.* Make.rules include/config.h
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000244 $(RM) `find . \( -name Makefile -o -size 0 \) -print`
Alexandre Julliarde2991ea1995-07-29 13:09:43 +0000245
Marcus Meissnerab554421999-01-23 13:59:51 +0000246# We depend on configure above for checks, so we better don't use this rule.
247#configure: configure.in
248# autoconf
Alexandre Julliard8cc3a5e1996-08-11 15:49:51 +0000249
250include/config.h.in: configure.in include/acconfig.h
251 autoheader -l include
252
Alexandre Julliard641ee761997-08-04 16:34:36 +0000253### Dependencies: