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.

100 lines
2.3 KiB

# $IdPath$
#
# 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!
#
# Problem to fix: to simplify this file, we probably want subdir Makefiles
# included into this one? But include directives vary between Make versions.
# Should bison/flex/perl rules even be included in this if it's not for
# development use?
#
# NOTE: Needs a valid config.h for the platform being compiled on.
#
# This file should be customized to particular platforms by changing CC and
# CFLAGS appropriately, along with writing a config.h for the platform.
CFLAGS=-DHAVE_CONFIG_H -IMkfiles -I. -Isrc -Isrc/arch/x86
CC=gcc
BISON=bison
FLEX=flex
PERL=perl
all: src/yasm
YASM_BASE_OBJS= \
src/bytecode.o \
src/expr.o \
src/symrec.o \
src/globals.o \
src/file.o \
src/section.o \
src/arch.o \
src/objfmt.o \
src/preproc.o \
src/parser.o \
src/intnum.o \
src/floatnum.o \
src/hamt.o \
src/bitvect.o \
src/valparam.o \
src/xmalloc.o \
src/xstrdup.o \
src/strcasecmp.o
YASM_ARCH_OBJS= \
src/arch/x86/x86arch.o \
src/arch/x86/x86bc.o \
src/arch/x86/x86expr.o
YASM_PARSER_OBJS= \
src/parsers/nasm/nasm-parser.o \
nasm-bison.o \
nasm-token.o
YASM_PREPROC_OBJS= \
src/preprocs/raw/raw-preproc.o \
src/preprocs/yapp/yapp-preproc.o \
yapp-token.o
YASM_OPTIMIZER_OBJS= \
src/optimizers/basic/basic-optimizer.o
YASM_OBJFMT_OBJS= \
src/objfmts/dbg/dbg-objfmt.o \
src/objfmts/bin/bin-objfmt.o
YASM_OBJS= \
src/main.o \
src/errwarn.o \
src/options.o \
$(YASM_BASE_OBJS) \
$(YASM_ARCH_OBJS) \
$(YASM_PARSER_OBJS) \
$(YASM_PREPROC_OBJS) \
$(YASM_OPTIMIZER_OBJS) \
$(YASM_OBJFMT_OBJS) \
mergesort.o
src/yasm: $(YASM_OBJS)
$(CC) -o src/yasm $(YASM_OBJS)
# This is broken: it produces an invalid bison.h
nasm-bison.c: nasm-bison.y
$(BISON) -d --name-prefix=nasm_parser_ -o $@ $<
nasm-token.c: nasm-token.l
$(FLEX) -Pnasm_parser_ -o$@ $<
nasm-bison.y nasm-token.l: src/arch/x86/instrs.dat src/parsers/nasm/bison.y.in src/parsers/nasm/token.l.in src/parsers/nasm/gen_instr.pl
$(PERL) src/parsers/nasm/gen_instr.pl -i src/arch/x86/instrs.dat -t nasm-token.l -g nasm-bison.y
yapp-token.c: src/preprocs/yapp/yapp-token.l
$(FLEX) -Pyapp_parser_ -o$@ $<
.c.o:
$(CC) -c $(CFLAGS) -o $@ $<