mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
fd68e9f1ac
These were part of the postcreate script previously, but with the new powers of sed, we can text-replace the library name and make changing them much more convenient.
28 lines
518 B
Text
28 lines
518 B
Text
#!/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
|