c0e157e3b2
One must build yasm (included in the yasm directory) before building GMP, if building on an x86_64 machine. Note: make test and make tune do not currently build.
240 lines
6.0 KiB
Makefile
240 lines
6.0 KiB
Makefile
# $Id: Makefile.flat 1988 2007-09-21 19:15:48Z peter $
|
|
#
|
|
# 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
|
|
# 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/assocdat.o \
|
|
libyasm/bitvect.o \
|
|
libyasm/bc-align.o \
|
|
libyasm/bc-data.o \
|
|
libyasm/bc-incbin.o \
|
|
libyasm/bc-org.o \
|
|
libyasm/bc-reserve.o \
|
|
libyasm/bytecode.o \
|
|
libyasm/errwarn.o \
|
|
libyasm/expr.o \
|
|
libyasm/file.o \
|
|
libyasm/floatnum.o \
|
|
libyasm/hamt.o \
|
|
libyasm/insn.o \
|
|
libyasm/intnum.o \
|
|
libyasm/inttree.o \
|
|
libyasm/linemap.o \
|
|
libyasm/md5.o \
|
|
libyasm/mergesort.o \
|
|
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 \
|
|
modules/arch/x86/x86id.o \
|
|
x86cpu.o \
|
|
x86regtmod.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_cv8
|
|
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/coff/win64-except.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/macho/macho-objfmt.o \
|
|
modules/objfmts/rdf/rdf-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_macho objfmt_macho32 objfmt_macho64
|
|
YASM_MODULES+=objfmt_rdf
|
|
YASM_MODULES+=objfmt_xdf
|
|
|
|
MODULES_PARSERS_OBJS= \
|
|
modules/parsers/nasm/nasm-parser.o \
|
|
modules/parsers/nasm/nasm-parse.o \
|
|
nasm-token.o \
|
|
modules/parsers/gas/gas-parser.o \
|
|
modules/parsers/gas/gas-parse.o \
|
|
gas-token.o
|
|
YASM_MODULES+=parser_nasm
|
|
YASM_MODULES+=parser_gas parser_gnu
|
|
|
|
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_CPP_OBJS = \
|
|
modules/preprocs/cpp/cpp-preproc.o
|
|
YASM_MODULES+=preproc_cpp
|
|
|
|
MODULES_PREPROCS_OBJS = \
|
|
$(MODULES_PREPROCS_NASM_OBJS) \
|
|
$(MODULES_PREPROCS_RAW_OBJS) \
|
|
$(MODULES_PREPROCS_CPP_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) -IMkfiles -I. -o $@ $<
|
|
|
|
version.mac: genversion
|
|
./genversion $@
|
|
|
|
genmodule: libyasm/genmodule.c
|
|
$(BUILDCC) -o $@ $<
|
|
|
|
module.c: libyasm/module.in genmodule
|
|
./genmodule libyasm/module.in Mkfiles/Makefile.flat
|
|
|
|
x86insn_nasm.gperf x86insn_gas.gperf x86insns.c: modules/arch/x86/gen_x86_insn.py
|
|
# ignore error in case python is not installed
|
|
-python modules/arch/x86/gen_x86_insn.py
|
|
|
|
x86insn_nasm.c: x86insn_nasm.gperf genperf
|
|
./genperf x86insn_nasm.gperf $@
|
|
|
|
x86insn_gas.c: x86insn_gas.gperf genperf
|
|
./genperf x86insn_gas.gperf $@
|
|
|
|
x86cpu.c: modules/arch/x86/x86cpu.gperf genperf
|
|
./genperf modules/arch/x86/x86cpu.gperf $@
|
|
|
|
x86regtmod.c: modules/arch/x86/x86regtmod.gperf genperf
|
|
./genperf modules/arch/x86/x86regtmod.gperf $@
|
|
|
|
modules/arch/x86/x86id.c: x86insn_nasm.c x86insn_gas.c x86insns.c
|
|
|
|
lc3bid.c: modules/arch/lc3b/lc3bid.re re2c
|
|
./re2c -s -o $@ modules/arch/lc3b/lc3bid.re
|
|
|
|
gas-token.c: modules/parsers/gas/gas-token.re re2c
|
|
./re2c -b -o $@ modules/parsers/gas/gas-token.re
|
|
|
|
nasm-token.c: modules/parsers/nasm/nasm-token.re re2c
|
|
./re2c -b -o $@ modules/parsers/nasm/nasm-token.re
|
|
|
|
RE2C_SRCS= \
|
|
tools/re2c/main.c \
|
|
tools/re2c/code.c \
|
|
tools/re2c/dfa.c \
|
|
tools/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)
|
|
|
|
GENPERF_SRCS= \
|
|
tools/genperf/genperf.c \
|
|
tools/genperf/perfect.c \
|
|
libyasm/phash.c \
|
|
libyasm/xmalloc.c \
|
|
libyasm/xstrdup.c
|
|
|
|
genperf: $(GENPERF_SRCS)
|
|
$(BUILDCC) -I. -o genperf $(GENPERF_SRCS)
|
|
|
|
yasm: $(YASM_OBJS)
|
|
$(CC) -o yasm $(YASM_OBJS)
|
|
|
|
.c.o:
|
|
$(CC) -c $(CFLAGS) -o $@ $<
|
|
|