Makefile: display firmware size
[RRG-proxmark3.git] / tools / mfd_aes_brute / Makefile
blob6f8fa44a927f19b5c4faecf43ecb936d6db58373
1 MYSRCPATHS = ../../common ../../common/mbedtls
2 MYSRCS = util_posix.c randoms.c
3 MYINCLUDES = -I../../include -I../../common -I../../common/mbedtls
4 MYCFLAGS = -O3 -ffast-math
5 MYDEFS =
6 MYLDLIBS = -lcrypto
8 SUPPORT_MARCH := $(shell $(CC) -xc /dev/null -c -o /dev/null -march=native > /dev/null 2>/dev/null && echo y)
9 SUPPORT_MCPU := $(shell $(CC) -xc /dev/null -c -o /dev/null -mcpu=native > /dev/null 2>/dev/null && echo y)
11 ifeq ($(DONT_BUILD_NATIVE),y)
12 # do nothing
13 else ifeq ($(SUPPORT_MARCH),y)
14 MYCFLAGS += -march=native
15 else ifeq ($(SUPPORT_MCPU),y)
16 MYCFLAGS += -mcpu=native
17 endif
19 ifneq ($(SKIPPTHREAD),1)
20 MYLDLIBS += -lpthread
21 endif
23 BINS = brute_key mfd_aes_brute mfd_multi_brute
24 INSTALLTOOLS = $(BINS)
26 include ../../Makefile.host
28 # checking platform can be done only after Makefile.host
29 ifneq (,$(findstring MINGW,$(platform)))
30 # Mingw uses by default Microsoft printf, we want the GNU printf (e.g. for %z)
31 # and setting _ISOC99_SOURCE sets internally __USE_MINGW_ANSI_STDIO=1
32 MYCFLAGS += -D_ISOC99_SOURCE
33 endif
35 # OS X needs linking to openssl
36 ifeq ($(USE_BREW),1)
37 MYCFLAGS += -I$(BREW_PREFIX)/opt/openssl@3/include -I$(BREW_PREFIX)/opt/openssl@1.1/include
38 MYLDFLAGS += -L$(BREW_PREFIX)/opt/openssl@3/lib -L$(BREW_PREFIX)/opt/openssl@1.1/lib
39 endif
41 ifeq ($(USE_MACPORTS),1)
42 MYCFLAGS += -I$(MACPORTS_PREFIX)/include/openssl-3 -I$(MACPORTS_PREFIX)/include/openssl-1.1
43 MYLDFLAGS += -L$(MACPORTS_PREFIX)/lib/openssl-3 -L$(MACPORTS_PREFIX)/lib/openssl-1.1
44 endif
46 showinfo:
47 @echo "C flags: $(MYCFLAGS)"
49 brute_key : $(OBJDIR)/brute_key.o $(MYOBJS)
51 mfd_aes_brute : $(OBJDIR)/mfd_aes_brute.o $(MYOBJS)
53 mfd_multi_brute : $(OBJDIR)/mfd_multi_brute.o $(MYOBJS)