-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
43 lines (30 loc) · 1.02 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
CC = g++
RM = rm -rf
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
OBJ_DIR := ./obj
SRC_DIRS := ./pc \
./src \
./src/applications \
./src/applications/openpgp \
./libs/stm32fs
SRC_FILES := $(sort $(foreach var, $(SRC_DIRS), $(wildcard $(var)/*.cpp)))
OBJ_FILES := $(patsubst %.cpp, $(OBJ_DIR)/%.o, $(notdir $(SRC_FILES)))
DEP_FILES = $(OBJ_FILES:.o=.d)
INC = -I. -Ipc/ -Isrc/ -Ilibs/mbedtls/ -Ilibs/mbedtls/mbedtls/crypto/include/\
-Ilibs/stm32fs/\
-Ilibs/bearssl/
CPPFLAGS = -std=c++17 -Os -Wall -g3 $(INC)
LDFLAGS = -Wl,-Bdynamic -lpthread
TARGET=openpgp_test
$(OBJ_DIR)/%.o:
$(CC) $(CPPFLAGS) -c -o $@ $(filter %/$(strip $(patsubst %.o, %.cpp, $(notdir $@))), $(SRC_FILES))
all: $(OBJ_FILES)
$(CC) -o $(TARGET) $^ $(LDFLAGS)
clean:
$(RM) $(OBJ_FILES) $(DEP_FILES) $(TARGET) $(MBEDTLS_OBJ) $(MBEDTLS_A)
testpy:
#cd ./pytest
cd ~/solo/gnuk/tests; py.test-3 -x
testc:
cd ./gtest; make clean; make all; ./ptest
testall: testc testpy