$(MAKE) -C $@ $(FLAGS)
./README: ./README.tmpl ./Server/tw_version.h
- sed "s/@VERSION@/`grep "define TW_VERSION" Server/tw_version.h | grep -Eo '"[^\]+' | sed -E 's/^"//g'`/g" ./README.tmpl > $@
+ sed "s/@VERSION@/`grep "define TW_VERSION" Server/tw_version.h | grep -Eo '"[^\]+' | sed 's/^"//g'`/g" ./README.tmpl > $@
install: all ./Tool/genconf ./Tool/itworks
mkdir -p $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/lib/tewi $(DESTDIR)$(PREFIX)/etc $(DESTDIR)$(PREFIX)/www
clang-format --verbose -i `find ./Server ./Common ./Module ./Tool "(" -name "*.c" -or -name "*.h" ")" -and -not -name "strptime.*"` config.h
get-version:
- @grep "define TW_VERSION" Server/tw_version.h | grep -Eo '"[^\]+' | sed -E 's/^"//g'
+ @grep "define TW_VERSION" Server/tw_version.h | grep -Eo '"[^\]+' | sed 's/^"//g'
clean:
$(MAKE) -C ./Server $(FLAGS) clean
CreateDirectory "$INSTDIR\modules"
CreateDirectory "$INSTDIR\bin"
SetOutPath "$INSTDIR"
- File /oname=LICENSE.txt "../LICENSE"
+ !cd ..
+ File /oname=LICENSE.txt "LICENSE"
SetOutPath "$INSTDIR\modules"
- File "../Module/*.dll"
+ !cd Module
+ File "*.dll"
+ !cd ..
SetOutPath "$INSTDIR\etc"
SetOverWrite off
- File /oname=tewi.conf "../generated.conf"
+ File /oname=tewi.conf "generated.conf"
SetOutPath "$INSTDIR\www"
- File /oname=index.html "../itworks.html"
- File /oname=pbtewi.gif "../Binary/pbtewi.gif"
+ File /oname=index.html "itworks.html"
+ !cd Binary
+ File /oname=pbtewi.gif "pbtewi.gif"
+ !cd ..
SetOutPath "$INSTDIR\www\icons"
- File "../Icons/*.png"
+ !cd Icons
+ File "*.png"
+ !cd ..
+ !cd Server
SetOverWrite on
CreateDirectory "$SMPROGRAMS\Tewi HTTPd"
Section "$(EXEC_ONLY)" SEL_EXEC
SetOutPath "$INSTDIR\bin"
- File "../tewi.exe"
+ !cd ..
+ File "tewi.exe"
+ !cd Server
WriteINIStr $INSTDIR\install.ini uninstall service false
SectionEnd
+!ifndef ONLY_EXEC
Section /o "$(SERV_TOO)" SEL_SERVICE
WriteINIStr $INSTDIR\install.ini uninstall service true
FileOpen $9 $INSTDIR\install.bat w
Sleep 1000
CreateDirectory "$INSTDIR\logs"
SetOutPath "$INSTDIR\bin"
- File "../tewi.exe"
- File /oname=tewisrv.exe "../tewi-service.exe"
+ !cd ..
+ File "tewi.exe"
+ File /oname=tewisrv.exe "tewi-service.exe"
+ !cd Server
FileOpen $9 $INSTDIR\install.bat w
FileWrite $9 '"$SYSDIR\sc.exe" delete "TewiHTTPd"$\r$\n'
FileWrite $9 '"$SYSDIR\sc.exe" create "TewiHTTPd" DisplayName= "Tewi HTTPd" binpath= "$INSTDIR\bin\tewisrv.exe" start= "auto"$\r$\n'
Pop $0
Delete $INSTDIR\install.bat
SectionEnd
+!endif
Function .onInit
StrCpy $1 ${SEL_EXEC}
Function .onSelChange
!insertmacro StartRadioButtons $1
!insertmacro RadioButton ${SEL_EXEC}
+ !ifndef ONLY_EXEC
!insertmacro RadioButton ${SEL_SERVICE}
+ !endif
!insertmacro EndRadioButtons
FunctionEnd
--- /dev/null
+#!/bin/sh
+# $Id$
+
+if [ "x$1" = "x" ]; then
+ echo "Usage: $0 win32|win64|vc6|bcc [description]"
+ exit 1
+fi
+
+fail() {
+ rm -f tewi.exe
+ rm -f generated.conf
+ rm -f itworks.html
+ exit 1
+}
+
+rm -f install.exe
+
+VERSION=`make get-version`
+
+make clean || fail
+make PLATFORM=$1 PREFIX=C:/Tewi -j4 || fail
+cp Server/tewi.exe tewi.exe
+cd Server
+../Tool/genconf "C:/Tewi" modules dll > ../generated.conf
+../Tool/itworks > ../itworks.html
+makensis /inputcharset utf8 -DVERSION=$VERSION -DONLY_EXEC install.nsi
+cp install.exe ../install.exe
+cd ..
+rm tewi.exe
+rm itworks.html
+rm generated.conf