Yasm Assembler mainline development tree (ffmpeg 依赖)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

212 lines
5.0 KiB

# $Id$
#
# Ultra-flat Makefile "prototype" for non-Unix platforms.
# Does NOT depend on or use configure.
#
# Works for simple build but *not* for development (no clean, dist, etc).
# Also, WARNING, no header dependencies are included!
#
# NOTE: Needs a valid config.h for the platform being compiled on.
#
# This file should be customized to particular platforms by changing CC and
Rewrite x86 identifier recognition to use a minimal perfect hash table instead of re2c-generated code. This gives identifier recognition a significant speedup and also drastically shortens compilation time of yasm itself. This rewrite encouraged combining instruction and prefix recognition into one function and register and target modifier recognition into a second function (rather than having 5 or so separate functions). Also created a state in the NASM parser (as was done in the GAS parser), so instructions/prefixes are only looked for until an instruction is recognized. This avoids search time in the instructions hash for operands. The tool used to generate the new identifier recognition is called GAP. Someday we might extend this to generate more code than just the perfect hash lookup. * tools/gap: New tool to Generate Architecture Parser (aka perfect hashes). * phash.c, phash.h: Helper functions used by GAP-generated code. * x86id.re: Delete. Split into.. * x86parse.gap: Contains all identifier recognition portions. * x86id.c: Contains instruction operand tables and code and higher-level entry points into x86parse.gap perfect hash recognizers. Chose to flow history of x86id.re into this file. * arch.h: Combine instruction/prefix entry points and register/target modifier entry points. * lc3barch.c, lc3bid.re, lc3barch.h: Update to match. * x86arch.c, x86arch.h: Update to match. * Makefile.am, various Makefile.inc: Update. * POTFILES.in: Update due to numerous file changes (not just this commit). * Mkfiles: Update. VC build files untested at the moment. svn path=/trunk/yasm/; revision=1395
19 years ago
# CFLAGS appropriately, along with writing a config.h and _stdint.h for the
# platform and placing them in a subdirectory of Mkfiles.
CFLAGS=-DHAVE_CONFIG_H -IMkfiles -I.
CC?=gcc
BUILDCC?=$(CC)
all: yasm
LIBYASM_OBJS= \
libyasm/arch.o \
libyasm/assocdat.o \
libyasm/bitvect.o \
libyasm/bytecode.o \
libyasm/errwarn.o \
libyasm/expr.o \
libyasm/file.o \
libyasm/floatnum.o \
libyasm/hamt.o \
libyasm/intnum.o \
libyasm/linemgr.o \
libyasm/md5.o \
libyasm/mergesort.o \
Rewrite x86 identifier recognition to use a minimal perfect hash table instead of re2c-generated code. This gives identifier recognition a significant speedup and also drastically shortens compilation time of yasm itself. This rewrite encouraged combining instruction and prefix recognition into one function and register and target modifier recognition into a second function (rather than having 5 or so separate functions). Also created a state in the NASM parser (as was done in the GAS parser), so instructions/prefixes are only looked for until an instruction is recognized. This avoids search time in the instructions hash for operands. The tool used to generate the new identifier recognition is called GAP. Someday we might extend this to generate more code than just the perfect hash lookup. * tools/gap: New tool to Generate Architecture Parser (aka perfect hashes). * phash.c, phash.h: Helper functions used by GAP-generated code. * x86id.re: Delete. Split into.. * x86parse.gap: Contains all identifier recognition portions. * x86id.c: Contains instruction operand tables and code and higher-level entry points into x86parse.gap perfect hash recognizers. Chose to flow history of x86id.re into this file. * arch.h: Combine instruction/prefix entry points and register/target modifier entry points. * lc3barch.c, lc3bid.re, lc3barch.h: Update to match. * x86arch.c, x86arch.h: Update to match. * Makefile.am, various Makefile.inc: Update. * POTFILES.in: Update due to numerous file changes (not just this commit). * Mkfiles: Update. VC build files untested at the moment. svn path=/trunk/yasm/; revision=1395
19 years ago
libyasm/phash.o \
libyasm/section.o \
libyasm/strcasecmp.o \
libyasm/strsep.o \
libyasm/symrec.o \
libyasm/valparam.o \
libyasm/value.o \
libyasm/xmalloc.o \
libyasm/xstrdup.o \
module.o
MODULES_ARCH_X86_OBJS= \
modules/arch/x86/x86arch.o \
modules/arch/x86/x86bc.o \
modules/arch/x86/x86expr.o \
Rewrite x86 identifier recognition to use a minimal perfect hash table instead of re2c-generated code. This gives identifier recognition a significant speedup and also drastically shortens compilation time of yasm itself. This rewrite encouraged combining instruction and prefix recognition into one function and register and target modifier recognition into a second function (rather than having 5 or so separate functions). Also created a state in the NASM parser (as was done in the GAS parser), so instructions/prefixes are only looked for until an instruction is recognized. This avoids search time in the instructions hash for operands. The tool used to generate the new identifier recognition is called GAP. Someday we might extend this to generate more code than just the perfect hash lookup. * tools/gap: New tool to Generate Architecture Parser (aka perfect hashes). * phash.c, phash.h: Helper functions used by GAP-generated code. * x86id.re: Delete. Split into.. * x86parse.gap: Contains all identifier recognition portions. * x86id.c: Contains instruction operand tables and code and higher-level entry points into x86parse.gap perfect hash recognizers. Chose to flow history of x86id.re into this file. * arch.h: Combine instruction/prefix entry points and register/target modifier entry points. * lc3barch.c, lc3bid.re, lc3barch.h: Update to match. * x86arch.c, x86arch.h: Update to match. * Makefile.am, various Makefile.inc: Update. * POTFILES.in: Update due to numerous file changes (not just this commit). * Mkfiles: Update. VC build files untested at the moment. svn path=/trunk/yasm/; revision=1395
19 years ago
modules/arch/x86/x86id.o
YASM_MODULES=arch_x86
MODULES_ARCH_LC3B_OBJS= \
modules/arch/lc3b/lc3barch.o \
modules/arch/lc3b/lc3bbc.o \
lc3bid.o
YASM_MODULES+=arch_lc3b
MODULES_ARCH_OBJS= \
$(MODULES_ARCH_X86_OBJS) \
$(MODULES_ARCH_LC3B_OBJS)
MODULES_DBGFMTS_OBJS= \
modules/dbgfmts/null/null-dbgfmt.o \
modules/dbgfmts/stabs/stabs-dbgfmt.o \
modules/dbgfmts/codeview/cv-dbgfmt.o \
modules/dbgfmts/codeview/cv-symline.o \
modules/dbgfmts/codeview/cv-type.o \
modules/dbgfmts/dwarf2/dwarf2-dbgfmt.o \
modules/dbgfmts/dwarf2/dwarf2-line.o \
modules/dbgfmts/dwarf2/dwarf2-info.o \
modules/dbgfmts/dwarf2/dwarf2-aranges.o
YASM_MODULES+=dbgfmt_null
YASM_MODULES+=dbgfmt_stabs
YASM_MODULES+=dbgfmt_dwarf2
MODULES_LISTFMTS_OBJS= \
modules/listfmts/nasm/nasm-listfmt.o
YASM_MODULES+=listfmt_nasm
MODULES_OBJFMTS_OBJS= \
modules/objfmts/dbg/dbg-objfmt.o \
modules/objfmts/bin/bin-objfmt.o \
modules/objfmts/coff/coff-objfmt.o \
modules/objfmts/elf/elf.o \
modules/objfmts/elf/elf-x86-x86.o \
modules/objfmts/elf/elf-x86-amd64.o \
modules/objfmts/elf/elf-objfmt.o \
modules/objfmts/xdf/xdf-objfmt.o
YASM_MODULES+=objfmt_dbg
YASM_MODULES+=objfmt_bin
YASM_MODULES+=objfmt_coff objfmt_win32 objfmt_win64 objfmt_x64
YASM_MODULES+=objfmt_elf objfmt_elf32 objfmt_elf64
YASM_MODULES+=objfmt_xdf
MODULES_OPTIMIZERS_OBJS= \
modules/optimizers/basic/basic-optimizer.o
YASM_MODULES+=optimizer_basic
MODULES_PARSERS_OBJS= \
modules/parsers/nasm/nasm-parser.o \
nasm-bison.o \
nasm-token.o \
modules/parsers/gas/gas-parser.o \
gas-bison.o \
gas-token.o
YASM_MODULES+=parser_nasm
YASM_MODULES+=parser_gas
MODULES_PREPROCS_NASM_OBJS= \
modules/preprocs/nasm/nasm-eval.o \
modules/preprocs/nasm/nasm-pp.o \
modules/preprocs/nasm/nasm-preproc.o \
modules/preprocs/nasm/nasmlib.o
YASM_MODULES+=preproc_nasm
MODULES_PREPROCS_RAW_OBJS = \
modules/preprocs/raw/raw-preproc.o
YASM_MODULES+=preproc_raw
MODULES_PREPROCS_OBJS = \
$(MODULES_PREPROCS_NASM_OBJS) \
$(MODULES_PREPROCS_RAW_OBJS)
MODULES_OBJS = \
$(MODULES_ARCH_OBJS) \
$(MODULES_DBGFMTS_OBJS) \
$(MODULES_LISTFMTS_OBJS) \
$(MODULES_OBJFMTS_OBJS) \
$(MODULES_OPTIMIZERS_OBJS) \
$(MODULES_PARSERS_OBJS) \
$(MODULES_PREPROCS_OBJS)
YASM_OBJS= \
frontends/yasm/yasm.o \
frontends/yasm/yasm-options.o \
$(LIBYASM_OBJS) \
$(MODULES_OBJS)
genstring: genstring.c
$(BUILDCC) -o $@ $<
license.c: COPYING genstring
./genstring license_msg $@ COPYING
frontends/yasm/yasm.c: license.c
genmacro: modules/preprocs/nasm/genmacro.c
$(BUILDCC) -o $@ $<
nasm-macros.c: modules/preprocs/nasm/standard.mac version.mac genmacro
./genmacro modules/preprocs/nasm/standard.mac version.mac
modules/preprocs/nasm/nasm-pp.c: nasm-macros.c
genversion: modules/preprocs/nasm/genversion.c
$(BUILDCC) -o $@ $<
version.mac: genversion
./genversion $@
genmodule: libyasm/genmodule.c
$(BUILDCC) -o $@ $<
module.c: libyasm/module.in genmodule
Rewrite x86 identifier recognition to use a minimal perfect hash table instead of re2c-generated code. This gives identifier recognition a significant speedup and also drastically shortens compilation time of yasm itself. This rewrite encouraged combining instruction and prefix recognition into one function and register and target modifier recognition into a second function (rather than having 5 or so separate functions). Also created a state in the NASM parser (as was done in the GAS parser), so instructions/prefixes are only looked for until an instruction is recognized. This avoids search time in the instructions hash for operands. The tool used to generate the new identifier recognition is called GAP. Someday we might extend this to generate more code than just the perfect hash lookup. * tools/gap: New tool to Generate Architecture Parser (aka perfect hashes). * phash.c, phash.h: Helper functions used by GAP-generated code. * x86id.re: Delete. Split into.. * x86parse.gap: Contains all identifier recognition portions. * x86id.c: Contains instruction operand tables and code and higher-level entry points into x86parse.gap perfect hash recognizers. Chose to flow history of x86id.re into this file. * arch.h: Combine instruction/prefix entry points and register/target modifier entry points. * lc3barch.c, lc3bid.re, lc3barch.h: Update to match. * x86arch.c, x86arch.h: Update to match. * Makefile.am, various Makefile.inc: Update. * POTFILES.in: Update due to numerous file changes (not just this commit). * Mkfiles: Update. VC build files untested at the moment. svn path=/trunk/yasm/; revision=1395
19 years ago
./genmodule libyasm/module.in $(YASM_MODULES)
Rewrite x86 identifier recognition to use a minimal perfect hash table instead of re2c-generated code. This gives identifier recognition a significant speedup and also drastically shortens compilation time of yasm itself. This rewrite encouraged combining instruction and prefix recognition into one function and register and target modifier recognition into a second function (rather than having 5 or so separate functions). Also created a state in the NASM parser (as was done in the GAS parser), so instructions/prefixes are only looked for until an instruction is recognized. This avoids search time in the instructions hash for operands. The tool used to generate the new identifier recognition is called GAP. Someday we might extend this to generate more code than just the perfect hash lookup. * tools/gap: New tool to Generate Architecture Parser (aka perfect hashes). * phash.c, phash.h: Helper functions used by GAP-generated code. * x86id.re: Delete. Split into.. * x86parse.gap: Contains all identifier recognition portions. * x86id.c: Contains instruction operand tables and code and higher-level entry points into x86parse.gap perfect hash recognizers. Chose to flow history of x86id.re into this file. * arch.h: Combine instruction/prefix entry points and register/target modifier entry points. * lc3barch.c, lc3bid.re, lc3barch.h: Update to match. * x86arch.c, x86arch.h: Update to match. * Makefile.am, various Makefile.inc: Update. * POTFILES.in: Update due to numerous file changes (not just this commit). * Mkfiles: Update. VC build files untested at the moment. svn path=/trunk/yasm/; revision=1395
19 years ago
x86parse.c: modules/arch/x86/x86parse.gap gap
./gap modules/arch/x86/x86parse.gap $@
modules/arch/x86/x86id.c: x86parse.c
lc3bid.c: modules/arch/lc3b/lc3bid.re re2c
Rewrite x86 identifier recognition to use a minimal perfect hash table instead of re2c-generated code. This gives identifier recognition a significant speedup and also drastically shortens compilation time of yasm itself. This rewrite encouraged combining instruction and prefix recognition into one function and register and target modifier recognition into a second function (rather than having 5 or so separate functions). Also created a state in the NASM parser (as was done in the GAS parser), so instructions/prefixes are only looked for until an instruction is recognized. This avoids search time in the instructions hash for operands. The tool used to generate the new identifier recognition is called GAP. Someday we might extend this to generate more code than just the perfect hash lookup. * tools/gap: New tool to Generate Architecture Parser (aka perfect hashes). * phash.c, phash.h: Helper functions used by GAP-generated code. * x86id.re: Delete. Split into.. * x86parse.gap: Contains all identifier recognition portions. * x86id.c: Contains instruction operand tables and code and higher-level entry points into x86parse.gap perfect hash recognizers. Chose to flow history of x86id.re into this file. * arch.h: Combine instruction/prefix entry points and register/target modifier entry points. * lc3barch.c, lc3bid.re, lc3barch.h: Update to match. * x86arch.c, x86arch.h: Update to match. * Makefile.am, various Makefile.inc: Update. * POTFILES.in: Update due to numerous file changes (not just this commit). * Mkfiles: Update. VC build files untested at the moment. svn path=/trunk/yasm/; revision=1395
19 years ago
./re2c -s -o $@ modules/arch/lc3b/lc3bid.re
gas-token.c: modules/parsers/gas/gas-token.re re2c
Rewrite x86 identifier recognition to use a minimal perfect hash table instead of re2c-generated code. This gives identifier recognition a significant speedup and also drastically shortens compilation time of yasm itself. This rewrite encouraged combining instruction and prefix recognition into one function and register and target modifier recognition into a second function (rather than having 5 or so separate functions). Also created a state in the NASM parser (as was done in the GAS parser), so instructions/prefixes are only looked for until an instruction is recognized. This avoids search time in the instructions hash for operands. The tool used to generate the new identifier recognition is called GAP. Someday we might extend this to generate more code than just the perfect hash lookup. * tools/gap: New tool to Generate Architecture Parser (aka perfect hashes). * phash.c, phash.h: Helper functions used by GAP-generated code. * x86id.re: Delete. Split into.. * x86parse.gap: Contains all identifier recognition portions. * x86id.c: Contains instruction operand tables and code and higher-level entry points into x86parse.gap perfect hash recognizers. Chose to flow history of x86id.re into this file. * arch.h: Combine instruction/prefix entry points and register/target modifier entry points. * lc3barch.c, lc3bid.re, lc3barch.h: Update to match. * x86arch.c, x86arch.h: Update to match. * Makefile.am, various Makefile.inc: Update. * POTFILES.in: Update due to numerous file changes (not just this commit). * Mkfiles: Update. VC build files untested at the moment. svn path=/trunk/yasm/; revision=1395
19 years ago
./re2c -b -o $@ modules/parsers/gas/gas-token.re
nasm-token.c: modules/parsers/nasm/nasm-token.re re2c
Rewrite x86 identifier recognition to use a minimal perfect hash table instead of re2c-generated code. This gives identifier recognition a significant speedup and also drastically shortens compilation time of yasm itself. This rewrite encouraged combining instruction and prefix recognition into one function and register and target modifier recognition into a second function (rather than having 5 or so separate functions). Also created a state in the NASM parser (as was done in the GAS parser), so instructions/prefixes are only looked for until an instruction is recognized. This avoids search time in the instructions hash for operands. The tool used to generate the new identifier recognition is called GAP. Someday we might extend this to generate more code than just the perfect hash lookup. * tools/gap: New tool to Generate Architecture Parser (aka perfect hashes). * phash.c, phash.h: Helper functions used by GAP-generated code. * x86id.re: Delete. Split into.. * x86parse.gap: Contains all identifier recognition portions. * x86id.c: Contains instruction operand tables and code and higher-level entry points into x86parse.gap perfect hash recognizers. Chose to flow history of x86id.re into this file. * arch.h: Combine instruction/prefix entry points and register/target modifier entry points. * lc3barch.c, lc3bid.re, lc3barch.h: Update to match. * x86arch.c, x86arch.h: Update to match. * Makefile.am, various Makefile.inc: Update. * POTFILES.in: Update due to numerous file changes (not just this commit). * Mkfiles: Update. VC build files untested at the moment. svn path=/trunk/yasm/; revision=1395
19 years ago
./re2c -b -o $@ modules/parsers/nasm/nasm-token.re
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)
Rewrite x86 identifier recognition to use a minimal perfect hash table instead of re2c-generated code. This gives identifier recognition a significant speedup and also drastically shortens compilation time of yasm itself. This rewrite encouraged combining instruction and prefix recognition into one function and register and target modifier recognition into a second function (rather than having 5 or so separate functions). Also created a state in the NASM parser (as was done in the GAS parser), so instructions/prefixes are only looked for until an instruction is recognized. This avoids search time in the instructions hash for operands. The tool used to generate the new identifier recognition is called GAP. Someday we might extend this to generate more code than just the perfect hash lookup. * tools/gap: New tool to Generate Architecture Parser (aka perfect hashes). * phash.c, phash.h: Helper functions used by GAP-generated code. * x86id.re: Delete. Split into.. * x86parse.gap: Contains all identifier recognition portions. * x86id.c: Contains instruction operand tables and code and higher-level entry points into x86parse.gap perfect hash recognizers. Chose to flow history of x86id.re into this file. * arch.h: Combine instruction/prefix entry points and register/target modifier entry points. * lc3barch.c, lc3bid.re, lc3barch.h: Update to match. * x86arch.c, x86arch.h: Update to match. * Makefile.am, various Makefile.inc: Update. * POTFILES.in: Update due to numerous file changes (not just this commit). * Mkfiles: Update. VC build files untested at the moment. svn path=/trunk/yasm/; revision=1395
19 years ago
GAP_SRCS= \
tools/gap/gap.c \
tools/gap/perfect.c \
libyasm/phash.c \
libyasm/xmalloc.c \
libyasm/xstrdup.c
gap: $(GAP_SRCS)
$(BUILDCC) -I. -o gap $(GAP_SRCS)
yasm: $(YASM_OBJS)
$(CC) -o yasm $(YASM_OBJS)
.c.o:
$(CC) -c $(CFLAGS) -o $@ $<