Commit 7d181cda authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Andrei Vagin

compel/test: Makefiles cleanup

1. Remove COMMON_IDIR -- there's no need for it, and it makes
   the build process look more complicated than it is.

2. Use standard CC and CFLAGS defines (so one can use say make CC=clang)

3. Drop the dependency on COMPEL_LIBRARY, as it's supposed to be
   an external file/tool.

4. Add -Wall to CFLAGS.

5. Simplify ARCH setting in infect test.

6. Drop ARCH from rsys test, as it's not used there.

travis-ci: success for More polishing for compel cli
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 52542586
ifeq ($(ARCH),)
ARCH := x86
endif
CC := gcc
CFLAGS ?= -O2 -g -Wall -Werror
ARCH ?= x86
# FIXME -- generate common symlink in compel/uapi
COMMON_IDIR := ../../../include
COMPEL := ../../../compel/compel-host
COMPEL_IDIR := ../../../compel/include/uapi
COMPEL_PACK_LDS := ../../../compel/arch/$(ARCH)/scripts/compel-pack.lds.S
......@@ -20,10 +18,10 @@ clean:
rm -f parasite.o
victim: victim.c
gcc -o $@ $^
$(CC) $(CFLAGS) -o $@ $^
spy: spy.c $(COMPEL_LIBRARY) | parasite.h
gcc -Werror -I$(COMPEL_IDIR) -I$(COMMON_IDIR) -o $@ $^
spy: spy.c | parasite.h
$(CC) $(CFLAGS) -I$(COMPEL_IDIR) -o $@ $^ $(COMPEL_LIBRARY)
parasite.h: parasite.po
$(COMPEL) hgen -f $^ -l 4 \
......@@ -34,4 +32,4 @@ parasite.po: parasite.o $(COMPEL_PLUGINS)/std.built-in.o
ld -r -T $(COMPEL_PACK_LDS) -o $@ $^
parasite.o: parasite.c
gcc -c $(shell $(COMPEL) --arch=$(ARCH) cflags) -I$(COMPEL_IDIR) -o $@ $^
$(CC) $(CFLAGS) -c $(shell $(COMPEL) --arch=$(ARCH) cflags) -I$(COMPEL_IDIR) -o $@ $^
ifeq ($(ARCH),)
ARCH := x86
endif
CC := gcc
CFLAGS ?= -O2 -g -Wall -Werror
# FIXME -- generate common symlink in compel/uapi
COMMON_IDIR := ../../../include
COMPEL_IDIR := ../../../compel/include/uapi
COMPEL_LIBRARY := ../../../compel/libcompel.a
......@@ -14,7 +11,7 @@ clean:
rm -f spy
victim: victim.c
gcc -o $@ $^
$(CC) $(CFLAGS) -o $@ $^
spy: spy.c $(COMPEL_LIBRARY)
gcc -Werror -I$(COMPEL_IDIR) -I$(COMMON_IDIR) -o $@ $^
spy: spy.c
$(CC) $(CFLAGS) -I$(COMPEL_IDIR) -o $@ $^ $(COMPEL_LIBRARY)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment