kpatch/kpatch-build/Makefile
Jessica Yu adcd4581cc kpatch-elf: introduce a common kpatch-elf and logging interface
Introduce a common kpatch elf api by moving all functions and struct
declarations related to manipulating kpatch_elf objects from
create-diff-object to kpatch-elf.{h,c}. Move logging macros to a separate
file log.h, and have kpatch-elf.h include it. These changes will generalize
the kpatch-elf and logging api and make it available to other kpatch-build
tools.
2016-07-12 14:45:16 -07:00

34 lines
709 B
Makefile

include ../Makefile.inc
CFLAGS += -I../kmod/patch -Iinsn -Wall -g -Werror
LDFLAGS += -lelf
TARGETS = create-diff-object
OBJS = create-diff-object.o kpatch-elf.o \
lookup.o insn/insn.o insn/inat.o
SOURCES = create-diff-object.c kpatch-elf.c \
lookup.c insn/insn.c insn/inat.c
all: $(TARGETS)
-include $(SOURCES:.c=.d)
%.o : %.c
$(CC) -MMD -MP $(CFLAGS) -c -o $@ $<
create-diff-object: $(OBJS)
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
install: all
$(INSTALL) -d $(LIBEXECDIR)
$(INSTALL) $(TARGETS) kpatch-gcc $(LIBEXECDIR)
$(INSTALL) -d $(BINDIR)
$(INSTALL) kpatch-build $(BINDIR)
uninstall:
$(RM) -R $(LIBEXECDIR)
$(RM) $(BINDIR)/kpatch-build
clean:
$(RM) $(TARGETS) $(OBJS) *.d insn/*.d