github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/src/tpm2/tpm2.mak (about)

     1  #
     2  #    Copyright 2014 John Manferdelli, All Rights Reserved.
     3  #    Licensed under the Apache License, Version 2.0 (the "License");
     4  #    you may not use this file except in compliance with the License.
     5  #    You may obtain a copy of the License at
     6  #        http://www.apache.org/licenses/LICENSE-2.0
     7  #    or in the the file LICENSE-2.0.txt in the top level sourcedirectory
     8  #    Unless required by applicable law or agreed to in writing, software
     9  #    distributed under the License is distributed on an "AS IS" BASIS,
    10  #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    11  #    See the License for the specific language governing permissions and
    12  #    limitations under the License
    13  #    Project: New Cloudproxy Crypto
    14  #    File: tpm2.mak
    15  
    16  #ifndef SRC_DIR
    17  SRC_DIR=$(HOME)
    18  #endif
    19  #ifndef OBJ_DIR
    20  OBJ_DIR=$(HOME)/cryptoobj
    21  #endif
    22  #ifndef EXE_DIR
    23  EXE_DIR=$(HOME)/cryptobin
    24  #endif
    25  #ifndef GOOGLE_INCLUDE
    26  GOOGLE_INCLUDE=/usr/local/include/google
    27  #endif
    28  #ifndef LOCAL_LIB
    29  LOCAL_LIB=/usr/local/lib
    30  #endif
    31  #ifndef TARGET_MACHINE_TYPE
    32  TARGET_MACHINE_TYPE= x64
    33  #endif
    34  
    35  S= $(SRC_DIR)/src/github.com/jlmucb/cloudproxy/src/tpm2
    36  O= $(OBJ_DIR)/tpm20
    37  INCLUDE= -I$(S) -I$(SRC_DIR)/keys -I/usr/local/include -I$(GOOGLE_INCLUDE)
    38  
    39  CFLAGS=$(INCLUDE) -O3 -g -Wall -std=c++11 -Wno-strict-aliasing -Wno-deprecated # -DGFLAGS_NS=google
    40  CFLAGS1=$(INCLUDE) -O1 -g -Wall -std=c++11
    41  
    42  CC=g++
    43  LINK=g++
    44  PROTO=protoc
    45  AR=ar
    46  export LD_LIBRARY_PATH=/usr/local/lib
    47  #LDFLAGS= $(LOCAL_LIB)/libgtest.a $(LOCAL_LIB)/libgflags.a -lpthread -lcrypto $(LOCAL_LIB)/libprotobuf.a
    48  LDFLAGS= -lprotobuf -lgtest -lgflags -lpthread -lcrypto
    49  
    50  dobj_tpm2_util=					$(O)/tpm2_lib.o \
    51    $(O)/tpm2.pb.o \
    52    $(O)/openssl_helpers.o \
    53    $(O)/conversions.o \
    54    $(O)/tpm2_util.o
    55  dobj_GeneratePolicyKey=				$(O)/tpm2_lib.o \
    56    $(O)/tpm2.pb.o \
    57    $(O)/openssl_helpers.o \
    58    $(O)/conversions.o \
    59    $(O)/GeneratePolicyKey.o
    60  dobj_CloudProxySignEndorsementKey=		$(O)/tpm2_lib.o \
    61    $(O)/tpm2.pb.o \
    62    $(O)/conversions.o \
    63    $(O)/openssl_helpers.o \
    64    $(O)/CloudProxySignEndorsementKey.o 
    65  dobj_GetEndorsementKey=				$(O)/tpm2_lib.o \
    66    $(O)/tpm2.pb.o \
    67    $(O)/conversions.o \
    68    $(O)/openssl_helpers.o \
    69    $(O)/GetEndorsementKey.o
    70  dobj_SelfSignPolicyCert=			$(O)/tpm2_lib.o \
    71    $(O)/openssl_helpers.o \
    72    $(O)/conversions.o \
    73    $(O)/tpm2.pb.o \
    74    $(O)/SelfSignPolicyCert.o
    75  dobj_CreateAndSaveCloudProxyKeyHierarchy=	$(O)/tpm2_lib.o \
    76    $(O)/tpm2.pb.o \
    77    $(O)/openssl_helpers.o \
    78    $(O)/conversions.o \
    79    $(O)/CreateAndSaveCloudProxyKeyHierarchy.o
    80  dobj_RestoreCloudProxyKeyHierarchy=		$(O)/tpm2_lib.o \
    81    $(O)/tpm2.pb.o \
    82    $(O)/openssl_helpers.o \
    83    $(O)/conversions.o \
    84    $(O)/RestoreCloudProxyKeyHierarchy.o
    85  dobj_ClientGenerateProgramKeyRequest=		$(O)/tpm2_lib.o \
    86    $(O)/tpm2.pb.o \
    87    $(O)/quote_protocol.o \
    88    $(O)/conversions.o \
    89    $(O)/openssl_helpers.o \
    90    $(O)/ClientGenerateProgramKeyRequest.o
    91  dobj_ServerSignProgramKeyRequest=		$(O)/tpm2_lib.o \
    92    $(O)/tpm2.pb.o \
    93    $(O)/quote_protocol.o \
    94    $(O)/conversions.o \
    95    $(O)/openssl_helpers.o \
    96    $(O)/ServerSignProgramKeyRequest.o
    97  dobj_ClientGetProgramKeyCert=			$(O)/tpm2_lib.o \
    98    $(O)/tpm2.pb.o \
    99    $(O)/conversions.o \
   100    $(O)/openssl_helpers.o \
   101    $(O)/ClientGetProgramKeyCert.o
   102  dobj_SigningInstructions=			$(O)/tpm2_lib.o \
   103    $(O)/tpm2.pb.o \
   104    $(O)/conversions.o \
   105    $(O)/openssl_helpers.o \
   106    $(O)/SigningInstructions.o
   107  dobj_PadTest =	$(O)/tpm2_lib.o \
   108    $(O)/tpm2.pb.o \
   109    $(O)/conversions.o \
   110    $(O)/quote_protocol.o \
   111    $(O)/openssl_helpers.o \
   112    $(O)/padtest.o
   113  
   114  all:	$(EXE_DIR)/tpm2_util.exe \
   115  	$(EXE_DIR)/GeneratePolicyKey.exe \
   116  	$(EXE_DIR)/SigningInstructions.exe \
   117  	$(EXE_DIR)/GetEndorsementKey.exe \
   118  	$(EXE_DIR)/SelfSignPolicyCert.exe \
   119  	$(EXE_DIR)/CloudProxySignEndorsementKey.exe \
   120  	$(EXE_DIR)/CreateAndSaveCloudProxyKeyHierarchy.exe \
   121  	$(EXE_DIR)/CloudProxySignEndorsementKey.exe \
   122  	$(EXE_DIR)/RestoreCloudProxyKeyHierarchy.exe \
   123  	$(EXE_DIR)/ClientGenerateProgramKeyRequest.exe \
   124  	$(EXE_DIR)/ServerSignProgramKeyRequest.exe \
   125  	$(EXE_DIR)/ClientGetProgramKeyCert.exe \
   126  	$(EXE_DIR)/padtest.exe
   127  
   128  clean:
   129  	@echo "removing object files"
   130  	rm $(O)/*.o
   131  	@echo "removing executable file"
   132  	rm $(EXE_DIR)/tpm2_util.exe
   133  	rm $(EXE_DIR)/GeneratePolicyKey.exe
   134  	rm $(EXE_DIR)/SigningInstructions.exe
   135  	rm $(EXE_DIR)/GetEndorsementKey.exe
   136  	rm $(EXE_DIR)/SelfSignPolicyCert.exe
   137  	rm $(EXE_DIR)/CloudProxySignEndorsementKey.exe
   138  	rm $(EXE_DIR)/CreateAndSaveCloudProxyKeyHierarchy.exe
   139  	rm $(EXE_DIR)/CloudProxySignEndorsementKey.exe
   140  	rm $(EXE_DIR)/RestoreCloudProxyKeyHierarchy.exe
   141  	rm $(EXE_DIR)/ClientGenerateProgramKeyRequest.exe
   142  	rm $(EXE_DIR)/ServerSignProgramKeyRequest.exe
   143  	rm $(EXE_DIR)/ClientGetProgramKeyCert.exe
   144  
   145  $(EXE_DIR)/tpm2_util.exe: $(dobj_tpm2_util)
   146  	@echo "linking tpm2_util"
   147  	$(LINK) -o $(EXE_DIR)/tpm2_util.exe $(dobj_tpm2_util) $(LDFLAGS)
   148  
   149  $(EXE_DIR)/GeneratePolicyKey.exe: $(dobj_GeneratePolicyKey)
   150  	@echo "linking GeneratePolicyKey"
   151  	$(LINK) -o $(EXE_DIR)/GeneratePolicyKey.exe $(dobj_GeneratePolicyKey) $(LDFLAGS)
   152  
   153  $(EXE_DIR)/CloudProxySignEndorsementKey.exe: $(dobj_CloudProxySignEndorsementKey)
   154  	@echo "linking CloudProxySignEndorsementKey"
   155  	$(LINK) -o $(EXE_DIR)/CloudProxySignEndorsementKey.exe $(dobj_CloudProxySignEndorsementKey) $(LDFLAGS)
   156  
   157  $(EXE_DIR)/GetEndorsementKey.exe: $(dobj_GetEndorsementKey)
   158  	@echo "linking GetEndorsementKey"
   159  	$(LINK) -o $(EXE_DIR)/GetEndorsementKey.exe $(dobj_GetEndorsementKey) $(LDFLAGS)
   160  
   161  $(EXE_DIR)/SelfSignPolicyCert.exe: $(dobj_SelfSignPolicyCert)
   162  	@echo "linking SelfSignPolicyCert"
   163  	$(LINK) -o $(EXE_DIR)/SelfSignPolicyCert.exe $(dobj_SelfSignPolicyCert) $(LDFLAGS)
   164  
   165  $(EXE_DIR)/CreateAndSaveCloudProxyKeyHierarchy.exe: $(dobj_CreateAndSaveCloudProxyKeyHierarchy)
   166  	@echo "linking CreateAndSaveCloudProxyKeyHierarchy"
   167  	$(LINK) -o $(EXE_DIR)/CreateAndSaveCloudProxyKeyHierarchy.exe $(dobj_CreateAndSaveCloudProxyKeyHierarchy) $(LDFLAGS)
   168  
   169  $(EXE_DIR)/RestoreCloudProxyKeyHierarchy.exe: $(dobj_RestoreCloudProxyKeyHierarchy)
   170  	@echo "linking RestoreCloudProxyKeyHierarchy"
   171  	$(LINK) -o $(EXE_DIR)/RestoreCloudProxyKeyHierarchy.exe $(dobj_RestoreCloudProxyKeyHierarchy) $(LDFLAGS)
   172  
   173  $(EXE_DIR)/ClientGenerateProgramKeyRequest.exe: $(dobj_ClientGenerateProgramKeyRequest)
   174  	@echo "linking ClientGenerateProgramKeyRequest"
   175  	$(LINK) -o $(EXE_DIR)/ClientGenerateProgramKeyRequest.exe $(dobj_ClientGenerateProgramKeyRequest) $(LDFLAGS)
   176  
   177  $(EXE_DIR)/ServerSignProgramKeyRequest.exe: $(dobj_ServerSignProgramKeyRequest)
   178  	@echo "linking ServerSignProgramKeyRequest"
   179  	$(LINK) -o $(EXE_DIR)/ServerSignProgramKeyRequest.exe $(dobj_ServerSignProgramKeyRequest) $(LDFLAGS)
   180  
   181  $(EXE_DIR)/ClientGetProgramKeyCert.exe: $(dobj_ClientGetProgramKeyCert)
   182  	@echo "linking ClientGetProgramKeyCert"
   183  	$(LINK) -o $(EXE_DIR)/ClientGetProgramKeyCert.exe $(dobj_ClientGetProgramKeyCert) $(LDFLAGS)
   184  
   185  $(EXE_DIR)/SigningInstructions.exe: $(dobj_SigningInstructions)
   186  	@echo "linking SigningInstructions"
   187  	$(LINK) -o $(EXE_DIR)/SigningInstructions.exe $(dobj_SigningInstructions) $(LDFLAGS)
   188  
   189  $(O)/tpm2.pb.o: $(S)/tpm2.pb.cc
   190  	@echo "compiling protobuf object"
   191  	$(CC) $(CFLAGS) -c -o $(O)/tpm2.pb.o $(S)/tpm2.pb.cc
   192  
   193  $(S)/tpm2.pb.cc tpm2.pb.h: $(S)/tpm2.proto
   194  	@echo "creating protobuf files"
   195  	$(PROTO) -I=$(S) --cpp_out=$(S) $(S)/tpm2.proto
   196  
   197  $(O)/tpm2_lib.o: $(S)/tpm2_lib.cc
   198  	@echo "compiling tpm2_lib.cc"
   199  	$(CC) $(CFLAGS) -c -o $(O)/tpm2_lib.o $(S)/tpm2_lib.cc
   200  
   201  $(O)/conversions.o: $(S)/conversions.cc
   202  	@echo "compiling conversions.cc"
   203  	$(CC) $(CFLAGS) -c -o $(O)/conversions.o $(S)/conversions.cc
   204  
   205  $(O)/openssl_helpers.o: $(S)/openssl_helpers.cc
   206  	@echo "compiling openssl_helpers.cc"
   207  	$(CC) $(CFLAGS) -c -o $(O)/openssl_helpers.o $(S)/openssl_helpers.cc
   208  
   209  $(O)/quote_protocol.o: $(S)/quote_protocol.cc
   210  	@echo "compiling quote_protocol.cc"
   211  	$(CC) $(CFLAGS) -c -o $(O)/quote_protocol.o $(S)/quote_protocol.cc
   212  
   213  $(O)/tpm2_util.o: $(S)/tpm2_util.cc
   214  	@echo "compiling tpm2_util.cc"
   215  	$(CC) $(CFLAGS) -c -o $(O)/tpm2_util.o $(S)/tpm2_util.cc
   216  
   217  $(O)/GeneratePolicyKey.o: $(S)/GeneratePolicyKey.cc
   218  	@echo "compiling GeneratePolicyKey.cc"
   219  	$(CC) $(CFLAGS) -c -o $(O)/GeneratePolicyKey.o $(S)/GeneratePolicyKey.cc
   220  
   221  $(O)/CloudProxySignEndorsementKey.o: $(S)/CloudProxySignEndorsementKey.cc
   222  	@echo "compiling CloudProxySignEndorsementKey.cc"
   223  	$(CC) $(CFLAGS) -c -o $(O)/CloudProxySignEndorsementKey.o $(S)/CloudProxySignEndorsementKey.cc
   224  
   225  $(O)/CreateAndSaveCloudProxyKeyHierarchy.o: $(S)/CreateAndSaveCloudProxyKeyHierarchy.cc
   226  	@echo "compiling CreateAndSaveCloudProxyKeyHierarchy.cc"
   227  	$(CC) $(CFLAGS) -c -o $(O)/CreateAndSaveCloudProxyKeyHierarchy.o $(S)/CreateAndSaveCloudProxyKeyHierarchy.cc
   228  
   229  $(O)/RestoreCloudProxyKeyHierarchy.o: $(S)/RestoreCloudProxyKeyHierarchy.cc
   230  	@echo "compiling RestoreCloudProxyKeyHierarchy.cc"
   231  	$(CC) $(CFLAGS) -c -o $(O)/RestoreCloudProxyKeyHierarchy.o $(S)/RestoreCloudProxyKeyHierarchy.cc
   232  
   233  $(O)/ClientGetProgramKeyCert.o: $(S)/ClientGetProgramKeyCert.cc
   234  	@echo "compiling ClientGetProgramKeyCert.cc"
   235  	$(CC) $(CFLAGS) -c -o $(O)/ClientGetProgramKeyCert.o $(S)/ClientGetProgramKeyCert.cc
   236  
   237  $(O)/ServerSignProgramKeyRequest.o: $(S)/ServerSignProgramKeyRequest.cc
   238  	@echo "compiling ServerSignProgramKeyRequest.cc"
   239  	$(CC) $(CFLAGS) -c -o $(O)/ServerSignProgramKeyRequest.o $(S)/ServerSignProgramKeyRequest.cc
   240  
   241  $(O)/ClientGenerateProgramKeyRequest.o: $(S)/ClientGenerateProgramKeyRequest.cc
   242  	@echo "compiling ClientGenerateProgramKeyRequest.cc"
   243  	$(CC) $(CFLAGS) -c -o $(O)/ClientGenerateProgramKeyRequest.o $(S)/ClientGenerateProgramKeyRequest.cc
   244  
   245  $(O)/GetEndorsementKey.o: $(S)/GetEndorsementKey.cc
   246  	@echo "compiling GetEndorsementKey.cc"
   247  	$(CC) $(CFLAGS) -c -o $(O)/GetEndorsementKey.o $(S)/GetEndorsementKey.cc
   248  
   249  $(O)/SelfSignPolicyCert.o: $(S)/SelfSignPolicyCert.cc
   250  	@echo "compiling SelfSignPolicyCert.cc"
   251  	$(CC) $(CFLAGS) -c -o $(O)/SelfSignPolicyCert.o $(S)/SelfSignPolicyCert.cc
   252  
   253  $(O)/SigningInstructions.o: $(S)/SigningInstructions.cc
   254  	@echo "compiling SigningInstructions.cc"
   255  	$(CC) $(CFLAGS) -c -o $(O)/SigningInstructions.o $(S)/SigningInstructions.cc
   256  
   257  $(O)/padtest.o: $(S)/padtest.cc
   258  	@echo "compiling padtest.cc"
   259  	$(CC) $(CFLAGS) -c -o $(O)/padtest.o $(S)/padtest.cc
   260  
   261  $(EXE_DIR)/padtest.exe: $(dobj_PadTest)
   262  	@echo "linking padtest"
   263  	$(LINK) -o $(EXE_DIR)/padtest.exe $(dobj_PadTest) $(LDFLAGS)
   264  
   265