| |
|
| include $(root)/test/compiler.mk |
include $(root)/test/compiler.mk |
| |
|
| |
src = $(filter %.c %.S %.s, $(wildcard $(srcdir)/$(name).*)) |
| api = ecrypt-$(type).h |
api = ecrypt-$(type).h |
| binary = ecrypt-test$(id)$(exe) |
binary = ecrypt-test$(id)$(exe) |
| |
|
| LDFLAGS = $(CFLAGS) |
LDFLAGS = $(CFLAGS) |
| TARGET_ARCH = $(arch) |
TARGET_ARCH = $(arch) |
| CPPFLAGS = -DECRYPT_API=$(api) $(defvar) -I$(root)/include -I$(srcdir) |
CPPFLAGS = -DECRYPT_API=$(api) $(defvar) -I$(root)/include -I$(srcdir) |
| VPATH = $(srcdir):$(root)/test:$(root)/api:$(root)/include |
|
| |
vpath %.h $(srcdir):$(root)/test:$(root)/api:$(root)/include |
| |
vpath %.c $(srcdir):$(root)/test:$(root)/api:$(root)/include |
| |
vpath %.s $(srcdir) |
| |
vpath %.S $(srcdir) |
| |
|
| build: $(binary) |
build: $(binary) |
| |
|
| run: $(binary) |
run: $(binary) |
| @echo $(run) ./$< |
@echo $(run) ./$< |
| |
|
| $(binary): ecrypt-test$(obj) ecrypt-$(type)$(obj) ./$(name)$(obj) |
$(binary): ecrypt-test$(testobj) ecrypt-$(type)$(testobj) $(name)$(testobj) |
| $(api): ecrypt-config.h ecrypt-machine.h ecrypt-portable.h |
$(api): ecrypt-config.h ecrypt-machine.h ecrypt-portable.h |
| ecrypt-test$(obj): $(api) |
ecrypt-test$(testobj): $(api) timers.h |
| ecrypt-$(type)$(obj): $(api) |
ecrypt-$(type)$(testobj): $(api) |
| $(name)$(obj): $(api) |
$(name)$(testobj): $(api) |
| |
|
| variants: $(api) |
variants: $(api) |
| max=`awk \ |
max=`awk \ |
| '/^#define[ \t]+ECRYPT_MAXVARIANT/ { print $$3; exit; }' $<`; \ |
'/^#define[ \t]+ECRYPT_MAXVARIANT/ { print $$3; exit; }' $<`; \ |
| var=0; while [ "$$var" -lt "$$max" ]; do var=$$((var+1)); \ |
var=0; while [ "$$var" -lt "$$max" ]; do var=`expr $$var + 1`; \ |
| echo $$var; \ |
echo $$var; \ |
| done > $@ |
done > $@ |
| |
|
| |
timestamp: $(src) $(api) ecrypt-test.c ecrypt-$(type).c timers.h |
| |
touch timestamp |
| |
|
| clean: |
clean: |
| $(RM) $(binary) *$(obj) |
$(RM) $(binary) $(name)$(testobj) |
| |
|
| |
mrproper: |
| |
$(RM) ecrypt-test* *.o *.obj *~ |
| |
|
| .PHONY: all build name hash run clean |
.PHONY: all build name hash run clean mrproper |