#!/bin/Shell # $1: Project name, filesystem safe # $2: Project full path # $3: Project name, namespace safe # FIXME: Use a single sed command once we support that. sed -i "s/\\\$LibName/$3/g" $2/Class1.h sed -i "s/\\\$LibName/$3/g" $2/Class1.cpp # Generate Makefile echo > $2/Makefile <<-EOF LIBRARY = $1.so OBJS = Class1.o CXXFLAGS = -g -std=c++2a all: \$(LIBRARY) \$(LIBRARY): \$(OBJS) \$(CXX) -shared -o \$@ \$(OBJS) %.o: %.cpp \$(CXX) \$(CXXFLAGS) -fPIC -o \$@ -c \$< clean: rm \$(OBJS) \$(LIBRARY) EOF