1 # Global rules shared by all makefiles
2 # The makefile must define at least TOPSRC and MODULE
4 # First some useful definitions
13 XLIB = @X_PRE_LIBS@ -lXext -lX11 @X_EXTRA_LIBS@
18 DIVINCL = -I$(TOPSRC)/include
19 ALLCFLAGS = $(CFLAGS) $(DEFS) $(X_CFLAGS) $(DIVINCL) $(EXTRA_DEFS)
22 BUILD = $(TOPSRC)/tools/build
23 WINERC = $(TOPSRC)/rc/winerc
24 WINELIB = $(TOPSRC)/libwine.a
25 SUBMAKE = $(MAKE) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'DEFS=$(DEFS)'
28 OBJS = $(C_SRCS:.c=.o) $(ASM_SRCS:.S=.o) $(EXTRA_OBJS)
36 $(CC) -c $(ALLCFLAGS) -o $*.o $<
42 echo "#include \"windows.h\"" >winerctmp.c
43 echo WINDOWS_H_ENDS_HERE >>winerctmp.c
45 $(CPP) $(DEFS) $(DIVINCL) -P winerctmp.c | sed -e '1,/^WINDOWS_H_ENDS_HERE/d' | $(WINERC) -c -o $* -p $*
49 echo "#include \"windows.h\"" >winerctmp.c
50 echo WINDOWS_H_ENDS_HERE >>winerctmp.c
52 $(CPP) $(DEFS) $(DIVINCL) -P winerctmp.c | sed -e '1,/^WINDOWS_H_ENDS_HERE/d' | $(WINERC) -c -o $* -p $*
56 # Rule to rebuild resource compiler
58 $(WINERC) check_winerc:
59 cd $(TOPSRC)/rc; $(SUBMAKE) winerc
62 # Rule for main module
65 $(LDCOMBINE) $(OBJS) -o $(MODULE).o
71 sed '/\#\#\# Dependencies/q' < Makefile > tmp_make
72 $(CC) $(ALLCFLAGS) -MM $(C_SRCS) >> tmp_make
76 $(RM) *.o \#*\# *~ *.bak *.flc tmp_make winerctmp.c