Please pardon my question as I'm somewhat new to Linux, C++ and makefiles.
I'm trying to write a simple program to check if I can access the PKCS#11 chip on an UltraSPARC processor. Basically, I want to print a response stating whether or not it finds it. My findEngine.c file is as follows:
#include "findEngine.h"
int main( int argc, char **argv )
{
clock_t start, end;
double elapsed;
start = clock();
/* Load all bundled ENGINEs into memory and make them visible */
//ENGINE_load_builtin_engines();
/* Register all of them for every algorithm they collectively implement */
//ENGINE_register_all_complete();
ENGINE *e;
const char *engine_id = "pkcs11";
ENGINE_load_builtin_engines();
e = ENGINE_by_id(engine_id);
if(!e)
/* the engine isn't available */
printf(" the engine isn't available\n");
return -1;
if(!ENGINE_init(e)) {
/* the engine couldn't initialise, release 'e' */
ENGINE_free(e);
printf(" the engine couldn't initialise, release");
return -2;
}
if(!ENGINE_set_default_RSA(e))
/* This should only happen when 'e' can't initialise, but the previous
* statement suggests it did. */
abort();
ENGINE_set_default_DSA(e);
ENGINE_set_default_ciphers(e);
/* Release the functional reference from ENGINE_init() */
ENGINE_finish(e);
/* Release the structural reference from ENGINE_by_id() */
ENGINE_free(e);
printf(" found engine\n");
end = clock();
elapsed = ((double) (end - start)) / CLOCKS_PER_SEC;
printf ("%e\n", elapsed);
return 0;
}
It successfully runs on my linux machine (in that it tells me the engine doesn't exist) when I compile it with this makefile:
OBJS = findEngine.o
EXECUTABLE = findEngine
CC=gcc
CFLAGS=-Wall -ggdb -DDEBUG
COMPILE=$(CC) $(CFLAGS) -c
all: $(EXECUTABLE)
findEngine : $(OBJS)
$(CC) -lpthread -lssl -o $(EXECUTABLE) $(OBJS)
findEngine.o : findEngine.c
$(COMPILE) -o findEngine.o findEngine.c
clean:
-rm $(OBJS) $(EXECUTABLE)
However I'm unaple to compile it with the make on the server with the UltraSPARC processor and I recieve the following error: "make: Fatal error: Command failed for target `findEngine.o'"
Can anyone help me get the code to compile and run on the UltraSPARC server?