$(CROSSOBJCOPY) -I elf64-little -O binary $< $@
.PHONY: all clean remove
-all: ${TARGET}
+all: ${BINDIR} ${TARGET}
+
+$(BINDIR):
+ mkdir -p ${BINDIR}
$(TARGET): $(OBJECTS) $(SVP64OBJECTS) $(ELFFILES) $(BINFILES)
$(CC) -o $@ $(OBJECTS) $(LDFLAGS)
#include <Python.h>
#include <stdint.h>
#include <stdio.h>
+#include <pwd.h>
+#include <string.h>
static const char* PLUGIN_NAME = "pypowersim";
static int python_initialized = 0;
// Initialize Python C API
Py_Initialize();
+ // To construct directory based on username, need $HOME
+ char homeIsaDir[100];
+ const char *homeDir = getenv("HOME"); // user specific - /home/[USER NAME]
+ strcat(homeIsaDir, homeDir);
+ strcat(homeIsaDir, "/src/openpower-isa/src/openpower/decoder/isa/");
+ printf(homeIsaDir);
+
PyObject* sysPath = PySys_GetObject((char*)"path");
- PyObject* curDir = PyUnicode_FromString("/home/markos/src/openpower-isa/src/openpower/decoder/isa/");
+ PyObject* curDir = PyUnicode_FromString(homeIsaDir);
PyList_Append(sysPath, curDir);
Py_DECREF(curDir);