diff --git a/gen/examples/ext/synth_shed/Makefile b/gen/examples/ext/synth_shed/Makefile new file mode 100644 index 0000000..88c143e --- /dev/null +++ b/gen/examples/ext/synth_shed/Makefile @@ -0,0 +1,38 @@ +include Makefile.conf + +TARGET_MODULE=synth_shed.so +# C++ +CXX=clang +CXXFLAGS+=-std=c++11 -g + +# Sources +SRCS+=$(wildcard *.cc) +OBJS+=$(SRCS:.cc=.o) + +#Compile +CXXFLAGS+=$(INCLUDES) -I$(PREFIX)/include + +#Link +LDFLAGS+=-undefined dynamic_lookup $(LIBS_PATH) $(LIBS) + + +$(info -----BUILD INFO----) +$(info SRCS $(SRCS)) +$(info OBJS $(OBJS)) + +.PHONY: all gen module clean + +all: gen module + +gen: + $(MAKE) -C gen + +module: $(TARGET_MODULE) + +$(TARGET_MODULE) : $(OBJS) + $(CXX) $(LDFLAGS) -o $@ $^ + +clean: + $(MAKE) -C gen clean + rm -f $(TARGET_MODULE) + rm -f $(OBJS) diff --git a/gen/examples/ext/synth_shed/Makefile.conf b/gen/examples/ext/synth_shed/Makefile.conf new file mode 100644 index 0000000..04a970a --- /dev/null +++ b/gen/examples/ext/synth_shed/Makefile.conf @@ -0,0 +1,18 @@ +# pyBind11 +PREFIX=/Users/heck/local-default + +# YML2 +YML2_PATH=$(HOME)/src/pepbase/default/yml2 +YML2_PROC=$(YML2_PATH)/yml2proc $(YML2_OPTS) +YML2_OPTS=--encoding=utf8 + +# GEN-CID +GEN_CID_DIR=../../../../gen_cid/ + +# C Python headers +INCLUDES+=-I/opt/local/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 + +# example lib +INCLUDES+=-I../../lib/synth_shed +LIBS+=-lsynth_shed +LIBS_PATH+=-L../../lib/synth_shed/ diff --git a/gen/examples/synth_shed/Makefile b/gen/examples/ext/synth_shed/gen/Makefile similarity index 91% rename from gen/examples/synth_shed/Makefile rename to gen/examples/ext/synth_shed/gen/Makefile index b456855..f0bce30 100644 --- a/gen/examples/synth_shed/Makefile +++ b/gen/examples/ext/synth_shed/gen/Makefile @@ -1,9 +1,8 @@ -include Makefile.conf +include ../Makefile.conf YML2_FILE=py_module.yml2 CC_FILE=py_module.cc - .PHONY = yml cc all: yml cc diff --git a/gen/examples/synth_shed/config.json b/gen/examples/ext/synth_shed/gen/config.json similarity index 82% rename from gen/examples/synth_shed/config.json rename to gen/examples/ext/synth_shed/gen/config.json index 0f53e81..eb53bb5 100644 --- a/gen/examples/synth_shed/config.json +++ b/gen/examples/ext/synth_shed/gen/config.json @@ -1,6 +1,6 @@ { "module_name": "synth_shed", - "header_filename": "../../src/synth_shed/synth_shed.h", + "header_filename": "../../../../examples/lib/synth_shed/synth_shed.h", "libclang_path": "/opt/local/libexec/llvm-9.0/lib/libclang.dylib", "variables": [ ], diff --git a/gen/examples/ext/synth_shed/synth_shed.cc b/gen/examples/ext/synth_shed/synth_shed.cc new file mode 100644 index 0000000..640f72c --- /dev/null +++ b/gen/examples/ext/synth_shed/synth_shed.cc @@ -0,0 +1,14 @@ +#include +#include +#include +#include +#include "synth_shed.h" + +using namespace std; + +PYBIND11_MODULE(synth_shed, m) { + #include "gen/py_module.cc" + + +} + diff --git a/gen/examples/synth_shed/Makefile.conf b/gen/examples/synth_shed/Makefile.conf deleted file mode 100644 index 00bfd37..0000000 --- a/gen/examples/synth_shed/Makefile.conf +++ /dev/null @@ -1,5 +0,0 @@ -YML2_PATH=$(HOME)/src/pepbase/default/yml2 -YML2_PROC=$(YML2_PATH)/yml2proc $(YML2_OPTS) -YML2_OPTS=--encoding=utf8 - -GEN_CID_DIR=../../gen_cid/