diff options
author | Erwin Jansen <jansene@google.com> | 2023-11-03 14:13:52 -0700 |
---|---|---|
committer | Erwin Jansen <jansene@google.com> | 2023-11-03 14:13:52 -0700 |
commit | ea4aac6e9f2da4b540dc715159f7e843281255da (patch) | |
tree | 8d24381d3c91193403b5752f7837385cea419bd8 | |
parent | 645e4f02c622ba67eb754000cc00c9db8be31f85 (diff) | |
download | nasm-emu-dev.tar.gz |
Add bazel BUILD fileemu-dev
This adds a build file that enables nasm to be compiled using bazel.
Change-Id: I5994228719710533a3e89b1ca80d568c7ac9f0c8
-rw-r--r-- | BUILD | 138 |
1 files changed, 138 insertions, 0 deletions
@@ -0,0 +1,138 @@ +licenses(["notice"]) + +exports_files(["LICENSE"]) + +INCLUDES = [ + ".", + "include", + "x86", + "asm", + "disasm", + "output", +] + +COPTS = select({ + ":windows": [], + "//conditions:default": [ + "-w", + "-DHAVE_CONFIG_H", + ], +}) + +cc_library( + name = "nasm_lib", + srcs = [ + "asm/assemble.c", + "asm/directbl.c", + "asm/directiv.c", + "asm/error.c", + "asm/eval.c", + "asm/exprdump.c", + "asm/exprlib.c", + "asm/float.c", + "asm/labels.c", + "asm/listing.c", + "asm/parser.c", + "asm/pptok.c", + "asm/pragma.c", + "asm/preproc.c", + "asm/preproc-nop.c", + "asm/quote.c", + "asm/rdstrnum.c", + "asm/segalloc.c", + "asm/stdscan.c", + "asm/strfunc.c", + "asm/tokhash.c", + "common/common.c", + "disasm/disasm.c", + "disasm/sync.c", + "macros/macros.c", + "nasmlib/badenum.c", + "nasmlib/bsi.c", + "nasmlib/crc64.c", + "nasmlib/file.c", + "nasmlib/filename.c", + "nasmlib/hashtbl.c", + "nasmlib/ilog2.c", + "nasmlib/malloc.c", + "nasmlib/md5c.c", + "nasmlib/mmap.c", + "nasmlib/path.c", + "nasmlib/perfhash.c", + "nasmlib/raa.c", + "nasmlib/rbtree.c", + "nasmlib/readnum.c", + "nasmlib/realpath.c", + "nasmlib/saa.c", + "nasmlib/srcfile.c", + "nasmlib/string.c", + "nasmlib/strlist.c", + "nasmlib/ver.c", + "nasmlib/zerobuf.c", + "output/codeview.c", + "output/legacy.c", + "output/nulldbg.c", + "output/nullout.c", + "output/outaout.c", + "output/outas86.c", + "output/outbin.c", + "output/outcoff.c", + "output/outdbg.c", + "output/outelf.c", + "output/outform.c", + "output/outieee.c", + "output/outlib.c", + "output/outmacho.c", + "output/outobj.c", + "output/outrdf2.c", + "output/strtbl.c", + "stdlib/snprintf.c", + "stdlib/strlcpy.c", + "stdlib/strnlen.c", + "stdlib/strrchrnul.c", + "stdlib/vsnprintf.c", + "x86/disp8.c", + "x86/iflag.c", + "x86/insnsa.c", + "x86/insnsb.c", + "x86/insnsd.c", + "x86/insnsn.c", + "x86/regdis.c", + "x86/regflags.c", + "x86/regs.c", + "x86/regvals.c", + ], + hdrs = glob([ + "*.h", + "include/*.h", + "x86/*.h", + "disasm/*.h", + "config/*.h", + "asm/*.h", + "output/*.h", + "nasmlib/*.h", + ]), + copts = COPTS, + includes = INCLUDES, +) + +cc_binary( + name = "nasm", + srcs = [ + "asm/nasm.c", + "nasmlib/zerobuf.c", + ], + copts = COPTS, + includes = INCLUDES, + visibility = ["@libjpeg_turbo//:__pkg__"], + deps = [ + ":nasm_lib", + ], +) + +config_setting( + name = "windows", + values = { + "cpu": "x64_windows", + }, +) |