2018-12-23 15:36:24 +01:00
|
|
|
CDEFINE =
|
2018-12-30 19:10:51 +01:00
|
|
|
CFLAGS = -Wall -Wextra -std=c11 -O2 -g $(CDEFINE) -I/home/zappa/.opam/bap/lib/ocaml
|
2018-12-23 15:36:24 +01:00
|
|
|
LIBDWARFW_DIR=../../libdwarfw/build
|
2018-12-30 19:10:51 +01:00
|
|
|
CLIBS = -L$(LIBDWARFW_DIR) -Wl,-rpath,$(LIBDWARFW_DIR) -lz -lelf -ldwarf -ldwarfw
|
|
|
|
OCAMLCLIBS = -ccopt -L$(LIBDWARFW_DIR) -ccopt -Wl,-rpath,$(LIBDWARFW_DIR) -cclib -lz -cclib -lelf -cclib -ldwarf -cclib -ldwarfw
|
2018-12-23 15:36:24 +01:00
|
|
|
|
2018-12-30 19:10:51 +01:00
|
|
|
|
|
|
|
all: test_dw.bin ml_dwarf_write.bin
|
2018-12-23 15:36:24 +01:00
|
|
|
|
|
|
|
test_%.bin: test_%.o dwarf_write.o
|
2018-12-30 19:10:51 +01:00
|
|
|
gcc $(CFLAGS) $^ /usr/lib/x86_64-linux-gnu/libelf.a $(CLIBS) -o $@
|
2018-12-23 15:36:24 +01:00
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
gcc $(CFLAGS) -c $< -o $@
|
|
|
|
|
2018-12-30 19:10:51 +01:00
|
|
|
ml_dwarf_write.bin: ml_dwarf_write.ml dwarf_write_stubs.c dwarf_write.o
|
|
|
|
ocamlopt -c dwarf_write_stubs.c
|
|
|
|
ocamlopt -o ml_dwarf_write.bin ml_dwarf_write.ml dwarf_write_stubs.o dwarf_write.o $(OCAMLCLIBS)
|
|
|
|
|
2018-12-23 15:36:24 +01:00
|
|
|
clean:
|
2018-12-30 19:10:51 +01:00
|
|
|
rm -f *.o *.bin
|
|
|
|
|
|
|
|
.PRECIOUS: %.o
|