2020-08-20 03:38:21 +08:00
|
|
|
MYSRCPATHS = ../../common ../../common/cryptorf
|
|
|
|
MYSRCS = cryptolib.c util.c
|
|
|
|
MYINCLUDES = -I../../common/cryptorf
|
2023-11-03 18:36:10 +08:00
|
|
|
MYCFLAGS = -O3
|
2020-08-20 03:38:21 +08:00
|
|
|
MYDEFS =
|
2023-09-13 02:22:04 +08:00
|
|
|
|
2023-09-16 15:32:47 +08:00
|
|
|
# build artifacts
|
|
|
|
BINS = cm sm sma sma_multi
|
|
|
|
INSTALLTOOLS = $(BINS)
|
|
|
|
|
|
|
|
|
|
|
|
include ../../Makefile.host
|
|
|
|
# checking platform can be done only after Makefile.host
|
2023-09-13 02:47:59 +08:00
|
|
|
|
2023-09-16 15:51:47 +08:00
|
|
|
# Atomic / pThread
|
2023-09-13 02:22:04 +08:00
|
|
|
# RPi Zero gcc requires -latomic
|
2023-09-16 15:32:47 +08:00
|
|
|
# macOS might not like pthread?
|
2023-09-13 02:22:04 +08:00
|
|
|
ifneq ($(platform),Darwin)
|
2023-09-16 15:51:47 +08:00
|
|
|
MYLDLIBS += -lpthread -latomic
|
2023-09-13 02:22:04 +08:00
|
|
|
endif
|
2020-08-19 21:24:32 +08:00
|
|
|
|
2023-09-16 15:32:47 +08:00
|
|
|
# macOS needs c++14 standard when compiling c++
|
2023-08-24 10:05:00 +08:00
|
|
|
ifeq ($(platform),Darwin)
|
2023-09-16 01:08:24 +08:00
|
|
|
MYCXXFLAGS = -std=c++14
|
2023-08-24 10:05:00 +08:00
|
|
|
endif
|
|
|
|
|
2020-08-20 03:38:21 +08:00
|
|
|
ifneq (,$(findstring MINGW,$(platform)))
|
|
|
|
# Mingw uses by default Microsoft printf, we want the GNU printf (e.g. for %z)
|
|
|
|
# and setting _ISOC99_SOURCE sets internally __USE_MINGW_ANSI_STDIO=1
|
2023-09-16 01:08:24 +08:00
|
|
|
MYCFLAGS += -D_ISOC99_SOURCE
|
2020-08-20 03:38:21 +08:00
|
|
|
endif
|
2020-08-19 21:24:32 +08:00
|
|
|
|
2023-09-16 15:32:47 +08:00
|
|
|
|
2020-08-20 03:38:21 +08:00
|
|
|
cm : $(OBJDIR)/cm.o $(MYOBJS)
|
|
|
|
sm : $(OBJDIR)/sm.o $(MYOBJS)
|
|
|
|
sma : $(OBJDIR)/sma.o $(MYOBJS)
|
|
|
|
sma_multi : $(OBJDIR)/sma_multi.o $(MYOBJS)
|