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: Kir Kolyshkin <kir@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Kir Kolyshkin 2016-12-17 03:21:55 -08:00 committed by Andrei Vagin
parent 5254258604
commit 7d181cda73
2 changed files with 12 additions and 17 deletions

View file

@ -1,9 +1,7 @@
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 $@ $^

View file

@ -1,9 +1,6 @@
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)