Commit 9c085cba authored by Alexandre Julliard's avatar Alexandre Julliard

makefiles: Add global rules for bison and lex files.

Also build the .c and .h files separately to allow parallel makes.
parent dfd1abfa
......@@ -10,6 +10,7 @@
*.so
*.tab.[ch]
*.tlb
*.yy.c
*_[cips].c
*~
/Make.rules
......@@ -21,4 +22,3 @@
/tags
/wine
Makefile
lex.yy.c
......@@ -109,16 +109,16 @@ prog_manext = 1
api_manext = 3w
conf_manext = 5
CLEAN_FILES = *.o *.a *.so *.ln *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej \
*.flc *.res *.mc.rc *.tab.[ch] @LEX_OUTPUT_ROOT@.c core
*.flc *.res *.mc.rc *.tab.[ch] *.yy.c core
OBJS = $(C_SRCS:.c=.o) $(EXTRA_OBJS)
OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) $(LEX_SRCS:.l=.yy.o) $(EXTRA_OBJS)
RCOBJS = $(RC_SRCS:.rc=.res.o)
LINTS = $(C_SRCS:.c=.ln)
# Implicit rules
.SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.o .idl .tlb .h .ok .sfd .ttf .man.in .man _c.c _i.c _p.c _s.c
.SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.o .idl .tlb .h .y .l .tab.c .tab.h .yy.c .ok .sfd .ttf .man.in .man _c.c _i.c _p.c _s.c
.c.o:
$(CC) -c $(ALLCFLAGS) -o $@ $<
......@@ -126,6 +126,15 @@ LINTS = $(C_SRCS:.c=.ln)
.s.o:
$(AS) -o $@ $<
.y.tab.c:
$(BISON) $(BISONFLAGS) -o $@ $<
.y.tab.h:
$(BISON) $(BISONFLAGS) --defines=$@ -o /dev/null $<
.l.yy.c:
$(LEX) $(LEXFLAGS) -t $< >$@ || ($(RM) $@ && exit 1)
.mc.mc.rc:
$(LDPATH) $(WMC) -i -U -H /dev/null -o $@ $<
......@@ -212,11 +221,13 @@ winapi_check:: dummy
# Rules for dependencies
DEPEND_SRCS = $(C_SRCS) $(C_SRCS16) $(RC_SRCS) $(RC_SRCS16) $(MC_SRCS) $(IDL_SRCS) $(BISON_SRCS) $(LEX_SRCS) $(EXTRA_SRCS)
$(SUBDIRS:%=%/__depend__): dummy
@cd `dirname $@` && $(MAKE) depend
depend: $(IDL_SRCS:.idl=.h) $(SUBDIRS:%=%/__depend__)
$(MAKEDEP) -C$(SRCDIR) -S$(TOPSRCDIR) -T$(TOPOBJDIR) $(EXTRAINCL) $(C_SRCS) $(C_SRCS16) $(RC_SRCS) $(RC_SRCS16) $(MC_SRCS) $(IDL_SRCS) $(EXTRA_SRCS)
$(MAKEDEP) -C$(SRCDIR) -S$(TOPSRCDIR) -T$(TOPOBJDIR) $(EXTRAINCL) $(DEPEND_SRCS)
.PHONY: depend $(SUBDIRS:%=%/__depend__)
......
......@@ -45,6 +45,10 @@ C_SRCS = \
upgrade.c \
where.c
BISON_SRCS = \
cond.y \
sql.y
RC_SRCS = msi.rc
RC_BINSRC = msi.rc
RC_BINARIES = \
......@@ -52,23 +56,10 @@ RC_BINARIES = \
instadvert.bmp \
instlocal.bmp
EXTRA_SRCS = sql.y cond.y
EXTRA_OBJS = sql.tab.o cond.tab.o
@MAKE_DLL_RULES@
sql.tab.c sql.tab.h: sql.y
$(BISON) -d $(SRCDIR)/sql.y -o sql.tab.c
cond.tab.c cond.tab.h: cond.y
$(BISON) -d $(SRCDIR)/cond.y -o cond.tab.c
# hack to allow parallel make
sql.tab.h: sql.tab.c
sql.tab.o: sql.tab.h
cond.tab.h: cond.tab.c
cond.tab.o: cond.tab.h
### Dependencies:
cond.tab.o: cond.tab.c
sql.tab.o: sql.tab.c
tokenize.o: sql.tab.h
### Dependencies:
......@@ -8,8 +8,8 @@ C_SRCS = \
preproc.c \
wpp.c
EXTRA_SRCS = ppy.y ppl.l
EXTRA_OBJS = ppy.tab.o @LEX_OUTPUT_ROOT@.o
LEX_SRCS = ppl.l
BISON_SRCS = ppy.y
all: $(MODULE)
......@@ -20,16 +20,7 @@ $(MODULE): $(OBJS)
$(AR) $@ $(OBJS)
$(RANLIB) $@
ppy.tab.c ppy.tab.h: ppy.y
$(BISON) -d $(SRCDIR)/ppy.y -o ppy.tab.c
# hack to allow parallel make
ppy.tab.h: ppy.tab.c
ppy.tab.o: ppy.tab.h
@LEX_OUTPUT_ROOT@.c: ppl.l
$(LEX) -o$@ $(SRCDIR)/ppl.l
@LEX_OUTPUT_ROOT@.o: ppy.tab.h
### Dependencies:
ppy.tab.o: ppy.tab.c
ppl.yy.o: ppl.yy.c ppy.tab.h
......@@ -28,8 +28,8 @@ C_SRCS = \
types.c \
winedbg.c
EXTRA_SRCS = dbg.y debug.l
EXTRA_OBJS = dbg.tab.o @LEX_OUTPUT_ROOT@.o
LEX_SRCS = debug.l
BISON_SRCS = dbg.y
MANPAGES = winedbg.man
......@@ -37,18 +37,6 @@ MANPAGES = winedbg.man
all: $(MANPAGES)
dbg.tab.c dbg.tab.h: dbg.y
$(BISON) -d -t $(SRCDIR)/dbg.y -o dbg.tab.c
# hack to allow parallel make
dbg.tab.h: dbg.tab.c
dbg.tab.o: dbg.tab.h
@LEX_OUTPUT_ROOT@.c: debug.l
$(LEX) $(SRCDIR)/debug.l
@LEX_OUTPUT_ROOT@.o: dbg.tab.h
install:: $(MANPAGES) $(DESTDIR)$(mandir)/man$(prog_manext)
$(INSTALL_DATA) winedbg.man $(DESTDIR)$(mandir)/man$(prog_manext)/winedbg.$(prog_manext)
......@@ -56,3 +44,6 @@ uninstall::
$(RM) $(DESTDIR)$(mandir)/man$(prog_manext)/winedbg.$(prog_manext)
### Dependencies:
dbg.tab.o: dbg.tab.c
debug.yy.o: debug.yy.c dbg.tab.h
......@@ -13,8 +13,7 @@ C_SRCS = \
string.c \
winhelp.c
EXTRA_SRCS = macro.lex.l
EXTRA_OBJS = @LEX_OUTPUT_ROOT@.o
LEX_SRCS = macro.lex.l
EXTRARCFLAGS = -DWINELIB
......@@ -22,7 +21,6 @@ RC_SRCS = rsrc.rc
@MAKE_PROG_RULES@
@LEX_OUTPUT_ROOT@.c: macro.lex.l
$(LEX) $(SRCDIR)/macro.lex.l
### Dependencies:
macro.lex.yy.o: macro.lex.yy.c
......@@ -20,8 +20,8 @@ C_SRCS = \
widl.c \
write_msft.c
EXTRA_SRCS = parser.y parser.l
EXTRA_OBJS = parser.tab.o @LEX_OUTPUT_ROOT@.o
LEX_SRCS = parser.l
BISON_SRCS = parser.y
INSTALLDIRS = $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man$(prog_manext)
......@@ -32,18 +32,6 @@ all: $(PROGRAMS) $(MANPAGES)
widl$(EXEEXT): $(OBJS) $(LIBWPP)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBWPP) $(LIBPORT) $(LEXLIB) $(LDFLAGS)
parser.tab.c parser.tab.h: parser.y
$(BISON) -d -t $(SRCDIR)/parser.y -o parser.tab.c
# hack to allow parallel make
parser.tab.h: parser.tab.c
parser.tab.o: parser.tab.h
@LEX_OUTPUT_ROOT@.c: parser.l
$(LEX) $(SRCDIR)/parser.l
@LEX_OUTPUT_ROOT@.o: parser.tab.h
install:: $(PROGRAMS) $(MANPAGES) $(INSTALLDIRS)
$(INSTALL_PROGRAM) widl$(EXEEXT) $(DESTDIR)$(bindir)/widl$(EXEEXT)
$(INSTALL_DATA) widl.man $(DESTDIR)$(mandir)/man$(prog_manext)/widl.$(prog_manext)
......@@ -52,3 +40,6 @@ uninstall::
$(RM) $(DESTDIR)$(bindir)/widl$(EXEEXT) $(DESTDIR)$(mandir)/man$(prog_manext)/widl.$(prog_manext)
### Dependencies:
parser.tab.o: parser.tab.c
parser.yy.o: parser.yy.c parser.tab.h
......@@ -15,27 +15,17 @@ C_SRCS = \
wmc.c \
write.c
EXTRA_SRCS = mcy.y
EXTRA_OBJS = mcy.tab.o
BISON_SRCS = mcy.y
INSTALLDIRS = $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man$(prog_manext)
all: $(PROGRAMS) $(MANPAGES)
mcl.o: mcy.tab.h
@MAKE_RULES@
wmc$(EXEEXT): $(OBJS)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBWINE_LDFLAGS) $(LIBPORT) $(LEXLIB) $(LDFLAGS)
mcy.tab.c mcy.tab.h: mcy.y
$(BISON) -d -t $(SRCDIR)/mcy.y -o mcy.tab.c
# hack to allow parallel make
mcy.tab.h: mcy.tab.c
mcy.tab.o: mcy.tab.h
install:: $(PROGRAMS) $(MANPAGES) $(INSTALLDIRS)
$(INSTALL_DATA) wmc.man $(DESTDIR)$(mandir)/man$(prog_manext)/wmc.$(prog_manext)
$(INSTALL_PROGRAM) wmc$(EXEEXT) $(DESTDIR)$(bindir)/wmc$(EXEEXT)
......@@ -44,3 +34,6 @@ uninstall::
$(RM) $(DESTDIR)$(bindir)/wmc$(EXEEXT) $(DESTDIR)$(mandir)/man$(prog_manext)/wmc.$(prog_manext)
### Dependencies:
mcy.tab.o: mcy.tab.c
mcl.o: mcy.tab.h
......@@ -19,8 +19,8 @@ C_SRCS = \
wrc.c \
writeres.c
EXTRA_SRCS = parser.y parser.l
EXTRA_OBJS = parser.tab.o @LEX_OUTPUT_ROOT@.o
LEX_SRCS = parser.l
BISON_SRCS = parser.y
INSTALLDIRS = $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man$(prog_manext)
......@@ -31,18 +31,6 @@ all: $(PROGRAMS) $(MANPAGES)
wrc$(EXEEXT): $(OBJS) $(LIBWPP)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBWPP) $(LIBWINE_LDFLAGS) $(LIBPORT) $(LEXLIB) $(LDFLAGS)
parser.tab.c parser.tab.h: parser.y
$(BISON) -d -t $(SRCDIR)/parser.y -o parser.tab.c
# hack to allow parallel make
parser.tab.h: parser.tab.c
parser.tab.o: parser.tab.h
@LEX_OUTPUT_ROOT@.c: parser.l
$(LEX) $(SRCDIR)/parser.l
@LEX_OUTPUT_ROOT@.o: parser.tab.h
install:: $(PROGRAMS) $(MANPAGES) $(INSTALLDIRS)
$(INSTALL_DATA) wrc.man $(DESTDIR)$(mandir)/man$(prog_manext)/wrc.$(prog_manext)
$(INSTALL_PROGRAM) wrc$(EXEEXT) $(DESTDIR)$(bindir)/wrc$(EXEEXT)
......@@ -51,3 +39,6 @@ uninstall::
$(RM) $(DESTDIR)$(bindir)/wrc$(EXEEXT) $(DESTDIR)$(mandir)/man$(prog_manext)/wrc.$(prog_manext)
### Dependencies:
parser.tab.o: parser.tab.c
parser.yy.o: parser.yy.c parser.tab.h
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment