1 # Global rules shared by all makefiles
2 # The makefile must define at least TOPSRC and MODULE
4 # First some useful definitions
14 XLIB = @X_PRE_LIBS@ -lXext -lX11 @X_EXTRA_LIBS@
19 DIVINCL = -I$(TOPSRC)/include
20 ALLCFLAGS = $(CFLAGS) $(DEFS) $(DIVINCL) $(X_CFLAGS) $(EXTRA_DEFS)
23 BUILD = $(TOPSRC)/tools/build
24 WINERC = $(TOPSRC)/rc/winerc
25 WINELIB = $(TOPSRC)/libwine.a
26 SUBMAKE = $(MAKE) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'DEFS=$(DEFS)'
29 OBJS = $(C_SRCS:.c=.o) $(ASM_SRCS:.S=.o) $(EXTRA_OBJS)
37 $(CC) -c $(ALLCFLAGS) -o $*.o $<
43 echo "#include \"windows.h\"" >winerctmp.c
44 echo WINDOWS_H_ENDS_HERE >>winerctmp.c
46 $(CPP) $(DEFS) $(DIVINCL) -DRC_INVOKED -P winerctmp.c | sed -e '1,/^WINDOWS_H_ENDS_HERE/d' | $(WINERC) -c -o $* -p $*
50 echo "#include \"windows.h\"" >winerctmp.c
51 echo WINDOWS_H_ENDS_HERE >>winerctmp.c
53 $(CPP) $(DEFS) $(DIVINCL) -P winerctmp.c | sed -e '1,/^WINDOWS_H_ENDS_HERE/d' | $(WINERC) -c -o $* -p $*
57 # Rule to rebuild resource compiler
59 $(WINERC) check_winerc:
60 cd $(TOPSRC)/rc; $(SUBMAKE) winerc
63 # Rule for main module
66 $(LDCOMBINE) $(OBJS) -o $(MODULE).o
72 sed '/\#\#\# Dependencies/q' < Makefile > tmp_make
73 $(CC) $(ALLCFLAGS) -MM $(C_SRCS) >> tmp_make
77 $(RM) *.o \#*\# *~ *.bak *.orig *.rej *.flc tmp_make winerctmp.c