2008-08-30 08:38:15 +00:00
|
|
|
TARGET := sysreg2
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
CC=gcc
|
2013-09-20 06:46:56 +00:00
|
|
|
CXX=g++
|
|
|
|
INCLUDE_DIR = -I/usr/include/libvirt/ -I/usr/include/libxml2/
|
|
|
|
CFLAGS := $(INCLUDE_DIR) -g -O0 -std=c99 -D_GNU_SOURCE -Wall -Wextra
|
|
|
|
CXXFLAGS := $(INCLUDE_DIR) -g -O0 -D_GNU_SOURCE -Wall -Wextra
|
2008-12-09 12:44:27 +00:00
|
|
|
LFLAGS := -L/usr/lib64
|
2009-03-21 01:39:04 +00:00
|
|
|
LIBS := -lvirt -lxml2
|
2008-08-30 08:38:15 +00:00
|
|
|
|
2013-09-20 06:46:56 +00:00
|
|
|
SRCS_C := utils.c console.c options.c raddr2line.c revision.c
|
2015-02-25 15:11:36 +00:00
|
|
|
SRCS_CPP := virt.cpp libvirt.cpp vmware_player.cpp kvm.cpp virtualbox.cpp
|
2008-08-30 08:38:15 +00:00
|
|
|
|
2013-09-20 06:46:56 +00:00
|
|
|
OBJS_C := $(SRCS_C:.c=.o)
|
|
|
|
OBJS_CPP := $(SRCS_CPP:.cpp=.o)
|
2008-08-30 08:38:15 +00:00
|
|
|
|
2013-09-20 06:46:56 +00:00
|
|
|
$(TARGET): $(OBJS_C) $(OBJS_CPP)
|
|
|
|
$(CXX) $(LFLAGS) -o $@ $(OBJS_CPP) $(OBJS_C) $(LIBS)
|
2013-01-01 12:48:51 +00:00
|
|
|
rm revision.c
|
2008-08-30 08:38:15 +00:00
|
|
|
|
2013-01-01 12:48:51 +00:00
|
|
|
.c.o: revision.c $<
|
2008-08-30 08:38:15 +00:00
|
|
|
$(CC) $(INC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2013-01-01 12:48:51 +00:00
|
|
|
revision.c:
|
|
|
|
echo 'const int SVNRev = ' > revision.c
|
2013-09-20 18:46:16 +00:00
|
|
|
LC_ALL=C LANG=C svn info | grep Revision | cut -f 2 -d " " >> revision.c
|
2013-01-01 12:48:51 +00:00
|
|
|
echo ';' >> revision.c
|
2008-08-30 08:38:15 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
-@rm $(TARGET)
|
2013-09-20 06:46:56 +00:00
|
|
|
-@rm $(OBJS_C)
|
|
|
|
-@rm $(OBJS_CPP)
|
2008-08-30 08:38:15 +00:00
|
|
|
|