From 4559fd8fcb68c8b96a621c3d1385da08396dd817 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 15 Oct 2005 04:39:32 +0000 Subject: [PATCH] * Makefile.flat, Makefile.dj: Further enhance flat/DJGPP Makefiles to build re2c. Now the only thing not built with these is the Bison parsers. svn path=/trunk/yasm/; revision=1283 --- Mkfiles/Makefile.dj | 39 +++++++++++++++++++++++++++++++++------ Mkfiles/Makefile.flat | 39 +++++++++++++++++++++++++++++++++------ 2 files changed, 66 insertions(+), 12 deletions(-) diff --git a/Mkfiles/Makefile.dj b/Mkfiles/Makefile.dj index d39de4ac..1305fe12 100644 --- a/Mkfiles/Makefile.dj +++ b/Mkfiles/Makefile.dj @@ -9,8 +9,9 @@ # How to compile: # make -fMkfiles/Makefile.dj -CFLAGS=-DHAVE_CONFIG_H -IMkfiles/dj -O2 -I. -Ifrontends/yasm -CC=gcc +CFLAGS=-DHAVE_CONFIG_H -IMkfiles/dj -O -I. +CC?=gcc +BUILDCC?=$(CC) all: yasm @@ -124,18 +125,44 @@ YASM_OBJS= \ $(MODULES_OBJS) genmacro: modules/preprocs/nasm/genmacro.c - $(CC) -o genmacro modules/preprocs/nasm/genmacro.c + $(BUILDCC) -o $@ $< nasm-macros.c: modules/preprocs/nasm/standard.mac genmacro - ./genmacro modules/preprocs/nasm/standard.mac + ./genmacro $< modules/preprocs/nasm/nasm-pp.c: nasm-macros.c genmodule: libyasm/genmodule.c - $(CC) -o genmodule libyasm/genmodule.c + $(BUILDCC) -o $@ $< module.c: libyasm/module.in genmodule - ./genmodule libyasm/module.in $(YASM_MODULES) + ./genmodule $< $(YASM_MODULES) + +x86id.c: modules/arch/x86/x86id.re re2c + ./re2c -s -o $@ $< + +lc3bid.c: modules/arch/lc3b/lc3bid.re re2c + ./re2c -s -o $@ $< + +gas-token.c: modules/parsers/gas/gas-token.re re2c + ./re2c -b -o $@ $< + +nasm-token.c: modules/parsers/nasm/nasm-token.re re2c + ./re2c -b -o $@ $< + +RE2C_SRCS= \ + tools/re2c/main.c \ + tools/re2c/code.c \ + tools/re2c/dfa.c \ + re2c-parser.c \ + tools/re2c/actions.c \ + tools/re2c/scanner.c \ + tools/re2c/mbo_getopt.c \ + tools/re2c/substr.c \ + tools/re2c/translate.c + +re2c: $(RE2C_SRCS) + $(BUILDCC) -I. -o re2c $(RE2C_SRCS) yasm: $(YASM_OBJS) $(CC) -o yasm $(YASM_OBJS) diff --git a/Mkfiles/Makefile.flat b/Mkfiles/Makefile.flat index 3fa5a246..df2a7947 100644 --- a/Mkfiles/Makefile.flat +++ b/Mkfiles/Makefile.flat @@ -12,8 +12,9 @@ # CFLAGS appropriately, along with writing a config.h for the platform and # placing it in a libyasm subdirectory. -CFLAGS=-DHAVE_CONFIG_H -IMkfiles -I. -Ifrontends/yasm -CC=gcc +CFLAGS=-DHAVE_CONFIG_H -IMkfiles -I. +CC?=gcc +BUILDCC?=$(CC) all: yasm @@ -127,18 +128,44 @@ YASM_OBJS= \ $(MODULES_OBJS) genmacro: modules/preprocs/nasm/genmacro.c - $(CC) -o genmacro modules/preprocs/nasm/genmacro.c + $(BUILDCC) -o $@ $< nasm-macros.c: modules/preprocs/nasm/standard.mac genmacro - ./genmacro modules/preprocs/nasm/standard.mac + ./genmacro $< modules/preprocs/nasm/nasm-pp.c: nasm-macros.c genmodule: libyasm/genmodule.c - $(CC) -o genmodule libyasm/genmodule.c + $(BUILDCC) -o $@ $< module.c: libyasm/module.in genmodule - ./genmodule libyasm/module.in $(YASM_MODULES) + ./genmodule $< $(YASM_MODULES) + +x86id.c: modules/arch/x86/x86id.re re2c + ./re2c -s -o $@ $< + +lc3bid.c: modules/arch/lc3b/lc3bid.re re2c + ./re2c -s -o $@ $< + +gas-token.c: modules/parsers/gas/gas-token.re re2c + ./re2c -b -o $@ $< + +nasm-token.c: modules/parsers/nasm/nasm-token.re re2c + ./re2c -b -o $@ $< + +RE2C_SRCS= \ + tools/re2c/main.c \ + tools/re2c/code.c \ + tools/re2c/dfa.c \ + re2c-parser.c \ + tools/re2c/actions.c \ + tools/re2c/scanner.c \ + tools/re2c/mbo_getopt.c \ + tools/re2c/substr.c \ + tools/re2c/translate.c + +re2c: $(RE2C_SRCS) + $(BUILDCC) -I. -o re2c $(RE2C_SRCS) yasm: $(YASM_OBJS) $(CC) -o yasm $(YASM_OBJS) -- 2.40.0