Release 961117
[wine/multimedia.git] / Make.rules.in
blobf8d1c90930410480efc4d50e3452f302dba507d6
1 # Global rules shared by all makefiles     -*-Makefile-*-
3 # Each individual makefile should define the following variables:
4 # TOPSRCDIR  : top-level source directory
5 # TOPOBJDIR  : top-level object directory
6 # SRCDIR     : source directory for this module
7 # MODULE     : name of the module being built
8 # C_SRCS     : C sources for the module
9 # GEN_C_SRCS : generated C sources (optional)
10 # ASM_SRCS   : assembly sources (optional)
11 # EXTRA_OBJS : extra object files (optional)
13 # First some useful definitions
15 SHELL     = /bin/sh
16 CC        = @CC@
17 CPP       = @CPP@
18 CFLAGS    = @CFLAGS@
19 OPTIONS   = @OPTIONS@
20 X_CFLAGS  = @X_CFLAGS@
21 X_LIBS    = @X_LIBS@
22 XPM_LIB   = -lXpm
23 XLIB      = @X_PRE_LIBS@ -lXext -lX11 @X_EXTRA_LIBS@
24 WINELIB   = -L$(TOPOBJDIR) -lwine
25 LDLIBS    = @LDLIBS@
26 YACC      = @YACC@
27 LEX       = @LEX@
28 LEXLIB    = @LEXLIB@
29 DIVINCL   = -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include -I$(SRCDIR) -I.
30 ALLCFLAGS = $(CFLAGS) $(DEFS) $(OPTIONS) $(DIVINCL) $(X_CFLAGS)
31 LDCOMBINE = ld -r
32 RM        = rm -f
33 BUILD     = $(TOPOBJDIR)/tools/build
34 MAKEDEP   = $(TOPOBJDIR)/tools/makedep
35 WINERC    = $(TOPOBJDIR)/rc/winerc
36 SUBMAKE   = $(MAKE) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'OPTIONS=$(OPTIONS)'
37 @SET_MAKE@
39 OBJS = $(GEN_C_SRCS:.c=.o) $(C_SRCS:.c=.o) $(ASM_SRCS:.S=.o) $(EXTRA_OBJS)
41 # Implicit rules
43 .SUFFIXES: .rc
45 .c.o:
46         $(CC) -c $(ALLCFLAGS) -o $*.o $<
48 .S.o:
49         $(CC) -c -o $*.o $<  
51 .rc.c:
52         echo "#include \"windows.h\"" >winerctmp.c
53         echo WINDOWS_H_ENDS_HERE >>winerctmp.c
54         cat $< >>winerctmp.c
55         $(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P winerctmp.c | sed -e '1,/^WINDOWS_H_ENDS_HERE/d' | $(WINERC) $(RCFLAGS) -c -o $* -p $*
56         $(RM) winerctmp.c
58 .rc.h:
59         echo "#include \"windows.h\"" >winerctmp.c
60         echo WINDOWS_H_ENDS_HERE >>winerctmp.c
61         cat $< >>winerctmp.c
62         $(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P winerctmp.c | sed -e '1,/^WINDOWS_H_ENDS_HERE/d' | $(WINERC) -c -o $* -p $*
63         $(RM) winerctmp.c
66 # Rule to rebuild resource compiler
68 $(WINERC) check_winerc:
69         cd $(TOPOBJDIR)/rc; $(SUBMAKE) winerc
71 # Rule to rebuild the makedep program
73 $(MAKEDEP) check_makedep:
74         cd $(TOPOBJDIR)/tools; $(SUBMAKE) makedep
76 # Rule for main module
78 $(MODULE).o: $(OBJS)
79         $(LDCOMBINE) $(OBJS) -o $(MODULE).o
82 # Misc. rules
84 depend:: $(MAKEDEP) $(C_SRCS) $(GEN_C_SRCS)
85         $(MAKEDEP) $(DIVINCL) -C. $(GEN_C_SRCS) -C$(SRCDIR) $(C_SRCS)
87 clean::
88         $(RM) *.o \#*\# *~ *.bak *.orig *.rej *.flc winerctmp.c $(GEN_C_SRCS) $(GEN_C_SRCS:.c=.h) $(PROGRAMS)
90 dummy:
92 # End of global rules