mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-05 09:52:54 +00:00
Base: Convert postcreate scripts to use heredoc
This commit is contained in:
parent
4c6a97e757
commit
0e5e6f2e08
Notes:
sideshowbarker
2024-07-18 07:03:19 +09:00
Author: https://github.com/sin-ack
Commit: 0e5e6f2e08
Pull-request: https://github.com/SerenityOS/serenity/pull/9352
Reviewed-by: https://github.com/alimpfard ✅
3 changed files with 83 additions and 72 deletions
|
@ -1,19 +1,21 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo "PROGRAM = $1" >> $2/Makefile
|
||||
echo "OBJS = main.o" >> $2/Makefile
|
||||
echo "CXXFLAGS = -g -std=c++2a" >> $2/Makefile
|
||||
echo "" >> $2/Makefile
|
||||
echo "all: \$(PROGRAM)" >> $2/Makefile
|
||||
echo "" >> $2/Makefile
|
||||
echo "\$(PROGRAM): \$(OBJS)" >> $2/Makefile
|
||||
echo " \$(CXX) -o \$@ \$(OBJS)" >> $2/Makefile
|
||||
echo "" >> $2/Makefile
|
||||
echo "%.o: %.cpp" >> $2/Makefile
|
||||
echo " \$(CXX) \$(CXXFLAGS) -o \$@ -c \$< " >> $2/Makefile
|
||||
echo "" >> $2/Makefile
|
||||
echo "clean:" >> $2/Makefile
|
||||
echo " rm \$(OBJS) \$(PROGRAM)" >> $2/Makefile
|
||||
echo "" >> $2/Makefile
|
||||
echo "run:" >> $2/Makefile
|
||||
echo " ./\$(PROGRAM)" >> $2/Makefile
|
||||
echo > $2/Makefile <<-EOF
|
||||
PROGRAM = $1
|
||||
OBJS = main.o
|
||||
CXXFLAGS = -g -std=c++2a
|
||||
|
||||
all: \$(PROGRAM)
|
||||
|
||||
\$(PROGRAM): \$(OBJS)
|
||||
\$(CXX) -o \$@ \$(OBJS)
|
||||
|
||||
%.o: %.cpp
|
||||
\$(CXX) \$(CXXFLAGS) -o \$@ -c \$<
|
||||
|
||||
clean:
|
||||
rm \$(OBJS) \$(PROGRAM)
|
||||
|
||||
run:
|
||||
./\$(PROGRAM)
|
||||
EOF
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue