Files
acrn-hypervisor/tools/acrn-crashlog/acrnprobe/Makefile
Liu Xinwu 6f9dfa49bf tools: acrn-crashlog: framework of acrn-crashlog
This is the first patch of acrn-crashlog.

This patch initializes the framework of acrn-crashlog: acrnprobe,
common, data, and usercrash. And it initializes the Makefile for
each part.

Signed-off-by: Liu Xinwu <xinwu.liu@intel.com>
Signed-off-by: CHEN Gang <gang.c.chen@intel.com>
Reviewed-by: Zhang Yanmin <yanmin.zhang@intel.com>
Reviewed-by: Liu Chuansheng <chuansheng.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Acked-by: Eddie Dong <Eddie.dong@intel.com>
2018-05-23 17:10:51 +08:00

39 lines
1022 B
Makefile

BASEDIR := $(shell pwd)
LIBS = -lpthread -lxml2 -lcrypto -lrt -lsystemd -ltelemetry
CFLAGS += $(INCLUDE)
CFLAGS += -g -O0 -std=gnu11
CFLAGS += -ffunction-sections -fdata-sections
LDFLAGS += $(LIBS) -Wl,--gc-sections
TARGET = $(BUILDDIR)/acrnprobe/bin/acrnprobe
all: check_dirs $(TARGET)
$(BUILDDIR)/acrnprobe/obj/%.o:%.c
$(CC) -c $(CFLAGS) $< -o $@
$(BUILDDIR)/acrnprobe/bin/acrnprobe: $(BUILDDIR)/acrnprobe/obj/main.o
$(CC) -o $@ $^ $(LDFLAGS)
clean:
@echo "Clean objects and binaries"
@if [ -d $(BUILDDIR)/acrnprobe/obj ]; then \
find $(BUILDDIR)/acrnprobe/obj -name "*.o" -exec $(RM) {} \; 2>&1 || exit 0; \
fi
@if [ -d $(BUILDDIR)/acrnprobe/bin ]; then \
$(RM) -r $(BUILDDIR)/acrnprobe/bin ; \
fi
@if [ -d $(BUILDDIR)/acrnprobe/obj ]; then \
$(RM) -r $(BUILDDIR)/acrnprobe/obj ; \
fi
check_dirs:
@if [ ! -d $(BUILDDIR)/acrnprobe/bin ]; then \
mkdir -p $(BUILDDIR)/acrnprobe/bin ; \
fi
@if [ ! -d $(BUILDDIR)/acrnprobe/obj ]; then \
mkdir -p $(BUILDDIR)/acrnprobe/obj ; \
fi