1#!/usr/bin/make -f 2 3#define variables 4IPP_API_INCLUDE_DIR = ../ext/ipp/include 5EXAMPLE_INSTALL_DIR = $(epidinstalldir)/example 6COMPRESSED_DEFAULT_FILES_INSTALL_DIR = $(epidinstalldir)/compressed_example 7 8SIGNMSG_INCLUDE_DIR = ./signmsg 9SIGNMSG_SRC = $(wildcard ./signmsg/src/*.c) 10SIGNMSG_OBJ = $(SIGNMSG_SRC:.c=.o) 11SIGNMSG_EXE = ./signmsg/src/signmsg$(EXE_EXTENSION) 12 13VERIFYSIG_INCLUDE_DIR = ./verifysig 14VERIFYSIG_SRC = $(wildcard ./verifysig/src/*.c) 15VERIFYSIG_OBJ = $(VERIFYSIG_SRC:.c=.o) 16VERIFYSIG_EXE = ./verifysig/src/verifysig$(EXE_EXTENSION) 17 18 19LIB_UTIL_DIR = ./util/src 20LIB_ARGTABLE_DIR = ../ext/argtable3 21LIB_IPPCP_DIR = ../ext/ipp/sources/ippcp/src 22LIB_MEMBER_DIR = ../epid/member 23LIB_VERIFIER_DIR = ../epid/verifier 24LIB_COMMON_DIR = ../epid/common 25 26#set linker flags 27LDFLAGS += -L$(LIB_UTIL_DIR) \ 28 -L$(LIB_ARGTABLE_DIR) \ 29 -L$(LIB_IPPCP_DIR) \ 30 -L$(LIB_COMMON_DIR) \ 31 -lcommon \ 32 -lippcp -lutil -largtable3 33 34ifneq ($(TSS_PATH),) 35 LDFLAGS += -L$(TSS_PATH) -ltss -lcrypto 36endif 37 38ifneq ($(TINY),) 39 LDFLAGS += -L$(LIB_MEMBER_DIR) -lmath -ltiny_stdlib 40endif 41 42$(VERIFYSIG_EXE): $(VERIFYSIG_OBJ) 43 $(CC) -o $@ $^ -L$(LIB_VERIFIER_DIR) -lverifier $(LDFLAGS) 44 45$(VERIFYSIG_OBJ): %.o: %.c 46 $(CC) -o $@ $(CFLAGS) -I$(LIB_UTIL_DIR)/../.. \ 47 -I$(LIB_ARGTABLE_DIR) \ 48 -I$(LIB_VERIFIER_DIR)/../.. \ 49 -I$(VERIFYSIG_INCLUDE_DIR) \ 50 -I$(IPP_API_INCLUDE_DIR) -c $^ 51 52 53$(SIGNMSG_EXE): $(SIGNMSG_OBJ) 54 $(CC) -o $@ $^ -L$(LIB_MEMBER_DIR) -lmember $(LDFLAGS) 55 56$(SIGNMSG_OBJ): %.o: %.c 57 $(CC) -o $@ $(CFLAGS) -I$(LIB_UTIL_DIR)/../.. \ 58 -I$(LIB_ARGTABLE_DIR) \ 59 -I$(LIB_MEMBER_DIR)/../.. \ 60 -I$(SIGNMSG_INCLUDE_DIR) \ 61 -I$(IPP_API_INCLUDE_DIR) -c $^ 62 63#target part 64build: all install 65 66all: $(VERIFYSIG_EXE) $(SIGNMSG_EXE) 67 68install: 69 mkdir -p '$(EXAMPLE_INSTALL_DIR)/data' 70 cp -r ./data/group* ./data/grprl_empty.bin \ 71 ./data/*.md '$(EXAMPLE_INSTALL_DIR)/data' 72 cp ./data/cacert.bin ./data/grprl.bin \ 73 ./data/privrl.bin ./data/sigrl.bin \ 74 ./data/mprivkey.dat ./data/pubkey.bin \ 75 '$(EXAMPLE_INSTALL_DIR)' 76 mkdir -p '$(EXAMPLE_INSTALL_DIR)/compressed_data' 77 cp -r ./compressed_data/group* ./compressed_data/grprl_empty.bin \ 78 ./compressed_data/*.md '$(EXAMPLE_INSTALL_DIR)/compressed_data' 79 mkdir -p '$(COMPRESSED_DEFAULT_FILES_INSTALL_DIR)' 80 cp ./compressed_data/cacert.bin ./compressed_data/grprl.bin \ 81 ./compressed_data/privrl.bin ./compressed_data/sigrl.bin \ 82 ./compressed_data/mprivkey.dat ./compressed_data/pubkey.bin \ 83 '$(COMPRESSED_DEFAULT_FILES_INSTALL_DIR)' 84 cp $(VERIFYSIG_EXE) $(SIGNMSG_EXE) '$(EXAMPLE_INSTALL_DIR)' 85 86clean: 87 rm -f $(VERIFYSIG_OBJ) \ 88 $(VERIFYSIG_EXE) \ 89 $(SIGNMSG_OBJ) \ 90 $(SIGNMSG_EXE) 91