From 0072e6e3e3265b7b55ee7d1d0ea035764fb1102a Mon Sep 17 00:00:00 2001 From: idea4good Date: Mon, 26 Aug 2019 11:16:39 +0800 Subject: [PATCH] 1h1cpp support 3 platform name --- 1h-1cpp.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/1h-1cpp.sh b/1h-1cpp.sh index 5c1902c..9705305 100644 --- a/1h-1cpp.sh +++ b/1h-1cpp.sh @@ -22,7 +22,8 @@ cd .. cat core.h widgets.h > GuiLiteRaw.h rm core.h widgets.h -# build GuiLite.cpp +# build GuiLite-xxx.cpp +cppFileName="GuiLite-win.cpp" cd core cat *.cpp > core.cpp mv core.cpp ../ @@ -34,6 +35,7 @@ do 1) echo "Choose 1" cat *linux*.cpp > adapter.cpp + cppFileName="GuiLite-linux.cpp" break ;; 2) @@ -44,6 +46,7 @@ do 3) echo "Choose 3" cat *unknow*.cpp > adapter.cpp + cppFileName="GuiLite-unknow.cpp" break ;; *) @@ -63,21 +66,21 @@ cd .. cat core.cpp adapter.cpp widgets.cpp > GuiLiteRaw.cpp rm core.cpp adapter.cpp widgets.cpp -# remove include core_include widgets_include from GuiLite.cpp +# remove include core_include widgets_include from GuiLiteRaw.cpp sed '/^#include.*core_include\|widgets_include.*/d' GuiLiteRaw.cpp > GuiLiteNoInclude.cpp -# include GuiLite.h to GuiLite.cpp +# include GuiLite.h to GuiLiteNoInclude.cpp sed -i '1s/^/#include "GuiLite.h" /' GuiLiteNoInclude.cpp # Delete empty lines or blank lines sed '/^$/d' GuiLiteRaw.h > GuiLite.h -sed '/^$/d' GuiLiteNoInclude.cpp > GuiLite.cpp +sed '/^$/d' GuiLiteNoInclude.cpp > $cppFileName # Verify -gcc -c GuiLite.cpp +gcc -c $cppFileName # clean rm GuiLiteRaw.h GuiLiteRaw.cpp GuiLiteNoInclude.cpp echo "Done!" -echo "You could find GuiLite.h/GuiLite.cpp in this folder" +echo "You could find GuiLite.h/$cppFileName in this folder"