Sweden-Number/Make.rules.in

196 lines
5.3 KiB
Makefile

# Global rules shared by all makefiles -*-Makefile-*-
#
# Each individual makefile should define the following variables:
# TOPSRCDIR : top-level source directory
# TOPOBJDIR : top-level object directory
# SRCDIR : source directory for this module
# MODULE : name of the module being built
# C_SRCS : C sources for the module (optional)
# ASM_SRCS : assembly sources (optional)
# GEN_ASM_SRCS : generated assembly sources (optional)
# RC_SRCS : resource source files (optional)
# SPEC_SRCS : interface definition files (optional)
# GLUE : C sources for which glue code needs to be generated (optional)
# EXTRA_SRCS : extra source files for make depend (optional)
# EXTRA_OBJS : extra object files (optional)
# WRCEXTRA : extra wrc flags (e.g. '-p _SysRes') (optional)
# First some useful definitions
SHELL = /bin/sh
CC = @CC@
CPP = @CPP@
CFLAGS = @CFLAGS@
OPTIONS = @OPTIONS@ -D_REENTRANT
X_CFLAGS = @X_CFLAGS@
X_LIBS = @X_LIBS@
XLIB = @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@
WINELIB = $(WINESTUB) -L$(TOPOBJDIR) -lwine
LIBS = @LIBS@
YACC = @YACC@
LEX = @LEX@
LEXLIB = @LEXLIB@
RANLIB = @RANLIB@
LN_S = @LN_S@
DIVINCL = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include
ALLCFLAGS = $(CFLAGS) $(DEFS) $(OPTIONS) $(DIVINCL) $(X_CFLAGS)
LDCOMBINE = ld -r
LDSHARED = @LDSHARED@
AR = ar rc
RM = rm -f
MV = mv
MKDIR = mkdir -p
C2MAN = @C2MAN@
LDCONFIG = @LDCONFIG@
MANSPECS = -w $(TOPSRCDIR)/relay32/gdi32.spec \
-w $(TOPSRCDIR)/relay32/user32.spec \
-w $(TOPSRCDIR)/relay32/comctl32.spec \
-w $(TOPSRCDIR)/relay32/comdlg32.spec \
-w $(TOPSRCDIR)/relay32/kernel32.spec
LINT = @LINT@
LINTFLAGS = @LINTFLAGS@
ALLLINTFLAGS = $(LINTFLAGS) $(DEFS) $(OPTIONS) $(DIVINCL)
WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi_check/winapi_check
BUILD = $(TOPOBJDIR)/tools/build@PROGEXT@
MAKEDEP = $(TOPOBJDIR)/tools/makedep@PROGEXT@
WINERC = $(TOPOBJDIR)/rc/winerc@PROGEXT@
WRC = $(TOPOBJDIR)/tools/wrc/wrc@PROGEXT@
WRCFLAGS = -c
WINESTUB = $(TOPOBJDIR)/library/winestub.o
SUBMAKE = $(MAKE) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'OPTIONS=$(OPTIONS)'
@SET_MAKE@
# Installation infos
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
prog_manext = 1
conf_manext = 5
includedir = @includedir@/wine
OBJS = $(C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) $(ASM_SRCS:.S=.o) $(RC_SRCS:.rc=.o) \
$(SPEC_SRCS:.spec=.spec.o) $(GLUE:.c=.glue.o) $(EXTRA_OBJS)
LINTS = $(C_SRCS:.c=.ln)
# Implicit rules
.SUFFIXES:
.SUFFIXES: .rc .res .spec .spec.c .spec.o .glue.c $(SUFFIXES)
.c.o:
$(CC) -c $(ALLCFLAGS) -o $*.o $<
.spec.c.spec.o:
$(CC) -c $(ALLCFLAGS) @GCC_NO_BUILTIN@ -o $*.spec.o $<
.s.o:
$(AS) -o $*.o $<
.S.o:
$(CC) -c -o $*.o $<
.rc.s:
$(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) $<
.rc.h:
$(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) -nh $<
.rc.res:
$(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) -r $<
.res.s:
$(WRC) $(WRCFLAGS) $(WRCEXTRA) -b $<
.res.h:
$(WRC) $(WRCFLAGS) $(WRCEXTRA) -bnh $<
.spec.spec.c:
$(BUILD) @BUILDFLAGS@ -o $@ -spec $<
.c.glue.c:
$(BUILD) @BUILDFLAGS@ -o $@ -glue $<
.c.ln:
$(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
# Rule to rebuild the resource compiler
$(WINERC) check_winerc:
cd $(TOPOBJDIR)/rc; $(SUBMAKE) winerc@PROGEXT@
$(WRC) check_wrc:
cd $(TOPOBJDIR)/tools/wrc; $(SUBMAKE) wrc@PROGEXT@
# Rule to rebuild the 'makedep' program
$(MAKEDEP) check_makedep:
cd $(TOPOBJDIR)/tools; $(SUBMAKE) makedep@PROGEXT@
# Rule to rebuild the 'build' program
$(BUILD) checkbuild:
cd $(TOPOBJDIR)/tools; $(SUBMAKE) build@PROGEXT@
# Rule for main module
$(MODULE).o: $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
$(LDCOMBINE) $(OBJS) -o $(MODULE).o
# Rules for makefile
Makefile: Makefile.in $(TOPSRCDIR)/configure
@echo Makefile is older than $?, please rerun $(TOPSRCDIR)/configure
@exit 1
all: Makefile
# Rules for auto documentation
man: $(C_SRCS)
for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/man3w -S3w $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done
html: $(C_SRCS)
for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/html -Th -iwindows.h $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done
# Rule for linting
$(MODULE).ln : $(LINTS)
if test "$(LINTS)" ; \
then \
$(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
$(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
else \
$(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
fi
lint:: $(MODULE).ln
# Rules for Windows API checking
winapi_check::
$(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
# Misc. rules
$(SPEC_SRCS:.spec=.spec.c): $(BUILD) $(TOPSRCDIR)/include/builtin16.h $(TOPSRCDIR)/include/builtin32.h
$(GLUE:.c=.glue.c): $(BUILD) $(TOPSRCDIR)/include/builtin16.h $(TOPSRCDIR)/include/builtin32.h
depend:: $(MAKEDEP) $(C_SRCS) $(RC_SRCS) $(EXTRA_SRCS)
$(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(EXTRA_SRCS)
clean::
$(RM) *.o *.ln \#*\# *~ *% .#* *.bak *.orig *.rej *.flc y.tab.c y.tab.h lex.yy.c core $(GEN_ASM_SRCS) $(RC_SRCS:.rc=.s) $(RC_SRCS:.rc=.h) $(SPEC_SRCS:.spec=.spec.c) $(GLUE:.c=.glue.c) $(PROGRAMS)
dummy:
# End of global rules