Release 960225
[wine.git] / Make.rules.in
blobd871a6f6038be6fd525a4a63c18ba15e7697c643
1 # Global rules shared by all makefiles
2 # The makefile must define at least TOPSRC and MODULE
4 # First some useful definitions
6 CC        = @CC@
7 CPP       = @CPP@
8 CFLAGS    = @CFLAGS@
9 DEFS      = @DEFS@
10 X_CFLAGS  = @X_CFLAGS@
11 X_LIBS    = @X_LIBS@
12 XPM_LIB   = -lXpm
13 XLIB      = @X_PRE_LIBS@ -lXext -lX11 @X_EXTRA_LIBS@
14 LDLIBS    = @LDLIBS@
15 YACC      = @YACC@
16 LEX       = @LEX@
17 LEXLIB    = @LEXLIB@
18 DIVINCL   = -I$(TOPSRC)/include
19 ALLCFLAGS = $(CFLAGS) $(DEFS) $(X_CFLAGS) $(DIVINCL) $(EXTRA_DEFS)
20 LDCOMBINE = ld -r
21 RM        = rm -f
22 BUILD     = $(TOPSRC)/tools/build
23 WINERC    = $(TOPSRC)/rc/winerc
24 WINELIB   = $(TOPSRC)/libwine.a
25 SUBMAKE   = $(MAKE) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'DEFS=$(DEFS)'
26 @SET_MAKE@
28 OBJS = $(C_SRCS:.c=.o) $(ASM_SRCS:.S=.o) $(EXTRA_OBJS)
31 # Implicit rules
33 .SUFFIXES: .rc
35 .c.o:
36         $(CC) -c $(ALLCFLAGS) -o $*.o $<
38 .S.o:
39         $(CC) -c -o $*.o $<  
41 .rc.c:
42         echo "#include \"windows.h\"" >winerctmp.c
43         echo WINDOWS_H_ENDS_HERE >>winerctmp.c
44         cat $< >>winerctmp.c
45         $(CPP) $(DEFS) $(DIVINCL) -P winerctmp.c | sed -e '1,/^WINDOWS_H_ENDS_HERE/d' | $(WINERC) -c -o $* -p $*
46         $(RM) winerctmp.c
48 .rc.h:
49         echo "#include \"windows.h\"" >winerctmp.c
50         echo WINDOWS_H_ENDS_HERE >>winerctmp.c
51         cat $< >>winerctmp.c
52         $(CPP) $(DEFS) $(DIVINCL) -P winerctmp.c | sed -e '1,/^WINDOWS_H_ENDS_HERE/d' | $(WINERC) -c -o $* -p $*
53         $(RM) winerctmp.c
56 # Rule to rebuild resource compiler
58 $(WINERC) check_winerc:
59         cd $(TOPSRC)/rc; $(SUBMAKE) winerc
62 # Rule for main module
64 $(MODULE).o: $(OBJS)
65         $(LDCOMBINE) $(OBJS) -o $(MODULE).o
68 # Misc. rules
70 depend:: $(C_SRCS)
71         sed '/\#\#\# Dependencies/q' < Makefile > tmp_make
72         $(CC) $(ALLCFLAGS) -MM $(C_SRCS) >> tmp_make
73         mv tmp_make Makefile
75 clean::
76         $(RM) *.o \#*\# *~ *.bak *.orig *.rej *.flc tmp_make winerctmp.c
78 dummy:
80 # End of global rules