mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-11-14 05:41:43 +08:00
eadacd82f5
Squash of the following commits (a full rebase was too hard :( ) *ef309cfdf
N - SWIG: create pm3.c (5 months ago) <Philippe Teuwen> *05ba6a73f
N - swig pm3_device -> pm3 (5 months ago) <Philippe Teuwen> *d59630183
N - swig: move pm3.i (5 months ago) <Philippe Teuwen> *6adcfad75
N - Fix historic make & cmake (5 months ago) <Philippe Teuwen> *bcbef2edf
N - Fix typo with script_embedded (5 months ago) <slurdge> *538ee4dab
N - Better SWIG integration: autogen func & attributes (5 months ago) <slurdge> *756b62466
N - SWIG: few helper scripts (5 months ago) <Philippe Teuwen> *47ba4acd0
N - SWIG %extend (5 months ago) <Philippe Teuwen> *21841cb9d
N - simplify scripts (5 months ago) <Philippe Teuwen> *78c4f7929
N - Revert "SWIG experiments: introduce context" (5 months ago) <Philippe Teuwen> *1562b75fc
N - SWIG experiments: introduce context (5 months ago) <Philippe Teuwen> *a503dfcd9
N - SWIG experiments (5 months ago) <Philippe Teuwen>
83 lines
3 KiB
Makefile
83 lines
3 KiB
Makefile
MYSRCPATHS =
|
|
MYINCLUDES = -I../../../common -I../../../include -I../../src -I../../include -I../jansson
|
|
MYCFLAGS =
|
|
MYDEFS =
|
|
MYSRCS = hardnested_bruteforce.c
|
|
|
|
cpu_arch = $(shell uname -m)
|
|
ifneq ($(findstring 86, $(cpu_arch)), )
|
|
MULTIARCHSRCS = hardnested_bf_core.c hardnested_bitarray_core.c
|
|
endif
|
|
ifneq ($(findstring amd64, $(cpu_arch)), )
|
|
MULTIARCHSRCS = hardnested_bf_core.c hardnested_bitarray_core.c
|
|
endif
|
|
ifeq ($(MULTIARCHSRCS), )
|
|
MYSRCS += hardnested_bf_core.c hardnested_bitarray_core.c
|
|
endif
|
|
|
|
LIB_A = libhardnested.a
|
|
|
|
MYOBJS = $(MYSRCS:%.c=$(OBJDIR)/%.o)
|
|
MYOBJS += $(MULTIARCHSRCS:%.c=$(OBJDIR)/%_NOSIMD.o) \
|
|
$(MULTIARCHSRCS:%.c=$(OBJDIR)/%_MMX.o) \
|
|
$(MULTIARCHSRCS:%.c=$(OBJDIR)/%_SSE2.o) \
|
|
$(MULTIARCHSRCS:%.c=$(OBJDIR)/%_AVX.o) \
|
|
$(MULTIARCHSRCS:%.c=$(OBJDIR)/%_AVX2.o)
|
|
|
|
SUPPORTS_AVX512 := $(shell echo | $(CC) -E -mavx512f - > /dev/null 2>&1 && echo "True" )
|
|
|
|
HARD_SWITCH_NOSIMD = -mno-mmx -mno-sse2 -mno-avx -mno-avx2
|
|
HARD_SWITCH_MMX = -mmmx -mno-sse2 -mno-avx -mno-avx2
|
|
HARD_SWITCH_SSE2 = -mmmx -msse2 -mno-avx -mno-avx2
|
|
HARD_SWITCH_AVX = -mmmx -msse2 -mavx -mno-avx2
|
|
HARD_SWITCH_AVX2 = -mmmx -msse2 -mavx -mavx2
|
|
HARD_SWITCH_AVX512 = -mmmx -msse2 -mavx -mavx2 -mavx512f
|
|
ifeq "$(SUPPORTS_AVX512)" "True"
|
|
HARD_SWITCH_NOSIMD += -mno-avx512f
|
|
HARD_SWITCH_MMX += -mno-avx512f
|
|
HARD_SWITCH_SSE2 += -mno-avx512f
|
|
HARD_SWITCH_AVX += -mno-avx512f
|
|
HARD_SWITCH_AVX2 += -mno-avx512f
|
|
MYOBJS += $(MULTIARCHSRCS:%.c=$(OBJDIR)/%_AVX512.o)
|
|
endif
|
|
|
|
include ../../../Makefile.host
|
|
|
|
$(OBJDIR)/%_NOSIMD.o : %.c $(OBJDIR)/%_NOSIMD.d
|
|
$(info DEBUG $<)
|
|
|
|
$(OBJDIR)/%_NOSIMD.o : %.c $(OBJDIR)/%_NOSIMD.d
|
|
$(info [-] CC(NOSIMD) $<)
|
|
$(Q)$(MKDIR) $(dir $@)
|
|
$(Q)$(CC) $(DEPFLAGS:%.Td=%_NOSIMD.Td) $(CFLAGS) $(HARD_SWITCH_NOSIMD) -c -o $@ $<
|
|
$(Q)$(MV) -f $(OBJDIR)/$*_NOSIMD.Td $(OBJDIR)/$*_NOSIMD.d && $(TOUCH) $@
|
|
|
|
$(OBJDIR)/%_MMX.o : %.c $(OBJDIR)/%_MMX.d
|
|
$(info [-] CC(MMX) $<)
|
|
$(Q)$(MKDIR) $(dir $@)
|
|
$(Q)$(CC) $(DEPFLAGS:%.Td=%_MMX.Td) $(CFLAGS) $(HARD_SWITCH_MMX) -c -o $@ $<
|
|
$(Q)$(MV) -f $(OBJDIR)/$*_MMX.Td $(OBJDIR)/$*_MMX.d && $(TOUCH) $@
|
|
|
|
$(OBJDIR)/%_SSE2.o : %.c $(OBJDIR)/%_SSE2.d
|
|
$(info [-] CC(SSE2) $<)
|
|
$(Q)$(MKDIR) $(dir $@)
|
|
$(Q)$(CC) $(DEPFLAGS:%.Td=%_SSE2.Td) $(CFLAGS) $(HARD_SWITCH_SSE2) -c -o $@ $<
|
|
$(Q)$(MV) -f $(OBJDIR)/$*_SSE2.Td $(OBJDIR)/$*_SSE2.d && $(TOUCH) $@
|
|
|
|
$(OBJDIR)/%_AVX.o : %.c $(OBJDIR)/%_AVX.d
|
|
$(info [-] CC(AVX) $<)
|
|
$(Q)$(MKDIR) $(dir $@)
|
|
$(Q)$(CC) $(DEPFLAGS:%.Td=%_AVX.Td) $(CFLAGS) $(HARD_SWITCH_AVX) -c -o $@ $<
|
|
$(Q)$(MV) -f $(OBJDIR)/$*_AVX.Td $(OBJDIR)/$*_AVX.d && $(TOUCH) $@
|
|
|
|
$(OBJDIR)/%_AVX2.o : %.c $(OBJDIR)/%_AVX2.d
|
|
$(info [-] CC(AVX2) $<)
|
|
$(Q)$(MKDIR) $(dir $@)
|
|
$(Q)$(CC) $(DEPFLAGS:%.Td=%_AVX2.Td) $(CFLAGS) $(HARD_SWITCH_AVX2) -c -o $@ $<
|
|
$(Q)$(MV) -f $(OBJDIR)/$*_AVX2.Td $(OBJDIR)/$*_AVX2.d && $(TOUCH) $@
|
|
|
|
$(OBJDIR)/%_AVX512.o : %.c $(OBJDIR)/%_AVX512.d
|
|
$(info [-] CC(AVX512) $<)
|
|
$(Q)$(MKDIR) $(dir $@)
|
|
$(Q)$(CC) $(DEPFLAGS:%.Td=%_AVX512.Td) $(CFLAGS) $(HARD_SWITCH_AVX512) -c -o $@ $<
|
|
$(Q)$(MV) -f $(OBJDIR)/$*_AVX512.Td $(OBJDIR)/$*_AVX512.d && $(TOUCH) $@
|