relocmain/Makefile

27 lines
574 B
Makefile

.PHONY: default all clean
GLIBCC ?= $(CC)
MUSLCC ?= x86_64-linux-musl-gcc
default: all
manip-exe: manip-exe.c manip-exe.h
$(CC) -o "$@" $< -Og -g
# 'export-dynamic' so that functions defined in the exe actually end up in .dynsym
hello.glibc: hello.c
$(GLIBCC) -o "$@" $< -Wl,--export-dynamic -Og -g
hello.musl: hello.c
$(MUSLCC) -o "$@" $< -Wl,--export-dynamic -Og -g
hello.%.manip: ./manip-exe hello.%
./$^ "$@" main2
@chmod +x "$@"
all: hello.glibc.manip hello.musl.manip
clean:
@$(RM) -v hello.glibc hello.glibc.manip manip-exe hello.musl hello.musl.manip