Home | History | Annotate | Download | only in example
      1 #!/usr/bin/make -f
      2 
      3 #define variables
      4 IPP_API_INCLUDE_DIR = ../ext/ipp/include
      5 EXAMPLE_INSTALL_DIR = $(epidinstalldir)/example
      6 COMPRESSED_DEFAULT_FILES_INSTALL_DIR = $(epidinstalldir)/compressed_example
      7 
      8 SIGNMSG_INCLUDE_DIR = ./signmsg
      9 SIGNMSG_SRC = $(wildcard ./signmsg/src/*.c)
     10 SIGNMSG_OBJ = $(SIGNMSG_SRC:.c=.o)
     11 SIGNMSG_EXE = ./signmsg/src/signmsg$(EXE_EXTENSION)
     12 
     13 VERIFYSIG_INCLUDE_DIR = ./verifysig
     14 VERIFYSIG_SRC = $(wildcard ./verifysig/src/*.c)
     15 VERIFYSIG_OBJ = $(VERIFYSIG_SRC:.c=.o)
     16 VERIFYSIG_EXE = ./verifysig/src/verifysig$(EXE_EXTENSION)
     17 
     18 
     19 LIB_UTIL_DIR = ./util/src
     20 LIB_ARGTABLE_DIR = ../ext/argtable3
     21 LIB_IPPCP_DIR = ../ext/ipp/sources/ippcp/src
     22 LIB_MEMBER_DIR = ../epid/member
     23 LIB_VERIFIER_DIR = ../epid/verifier
     24 LIB_COMMON_DIR = ../epid/common
     25 
     26 #set linker flags
     27 LDFLAGS += -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 
     34 ifneq ($(TSS_PATH),)
     35 	LDFLAGS += -L$(TSS_PATH) -ltss -lcrypto
     36 endif
     37 
     38 ifneq ($(TINY),)
     39 	LDFLAGS += -L$(LIB_MEMBER_DIR) -lmath -ltiny_stdlib
     40 endif
     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
     64 build: all install
     65 
     66 all: $(VERIFYSIG_EXE) $(SIGNMSG_EXE)
     67 
     68 install:
     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 
     86 clean:
     87 	rm -f $(VERIFYSIG_OBJ) \
     88 		$(VERIFYSIG_EXE) \
     89 		$(SIGNMSG_OBJ) \
     90 		$(SIGNMSG_EXE)
     91