aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrayhogenson <rayhogenson@gmail.com>2014-03-15 00:10:09 -0800
committerrayhogenson <rayhogenson@gmail.com>2014-03-15 00:10:09 -0800
commit35643398483374ea573dc51d0e90e1b8e3727e48 (patch)
tree912ca7f453067d0f19c5319eea52da10fc98d222
parent7e5ecb0d0325133eee3cd6e66ccf7fdb96c231d0 (diff)
downloadyetihack-35643398483374ea573dc51d0e90e1b8e3727e48.tar.zst
added cmake support
-rwxr-xr-xconfigure10
-rw-r--r--os/linux/Makefile19
-rw-r--r--os/windows/Makefile18
-rw-r--r--os/windows/install.nsi97
-rw-r--r--os/windows/yetihack-windows/pdcurses.dllbin118784 -> 0 bytes
-rw-r--r--src/YetiHack.cpp8
6 files changed, 4 insertions, 148 deletions
diff --git a/configure b/configure
deleted file mode 100755
index 5a1a644..0000000
--- a/configure
+++ /dev/null
@@ -1,10 +0,0 @@
-if [[ "$1" == "linux" ]]; then
- cp os/linux/Makefile ./
-elif [[ "$1" == "windows" ]]; then
- cp os/windows/Makefile ./
-else
- echo "Error! Please use an os in the os folder"
- exit 1
-fi
-mkdir package
-exit 0
diff --git a/os/linux/Makefile b/os/linux/Makefile
deleted file mode 100644
index b706768..0000000
--- a/os/linux/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-yetihack: src/YetiHack.cpp src/yeti.cpp
- cd src && make
-
-package: yetihack
- strip src/yetihack
- zip -j package/yetihack.zip src/yetihack
- mkdir package/yetihack
- cp src/yetihack package/yetihack/yetihack
- cd package && tar -caf yetihack.tar.gz yetihack
- rm -r package/yetihack
-
-install: yetihack
- cp src/yetihack /usr/local/bin/
-
-clean:
- -rm src/*.o
- -rm src/yetihack
- -rm package/*
-
diff --git a/os/windows/Makefile b/os/windows/Makefile
deleted file mode 100644
index b8985ed..0000000
--- a/os/windows/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-yetihack.exe: src/YetiHack.cpp src/yeti.cpp
- i486-mingw32-g++ src/YetiHack.cpp src/yeti.cpp -o src/yetihack.exe -L os/windows/yetihack-windows/pdcurses.dll -static -lpdcurses -Iinclude -static-libgcc -static-libstdc++ -DWINDOWS
- -rm os/windows/yetihack-windows/yetihack.exe
- ln src/yetihack.exe os/windows/yetihack-windows/
-
-package: yetihack.exe
- makensis os/windows/install.nsi
- cd os/windows/yetihack-windows && zip ../../../package/yetihack-windows.zip *
-
-install: yetihack.exe package
- ./YetiHack_installer.exe
-
-clean:
- -rm src/yetihack.exe
- -rm package/YetiHack_installer.exe
- -rm package/yetihack-windows.zip
- -rm os/windows/yetihack-windows/yetihack.exe
-
diff --git a/os/windows/install.nsi b/os/windows/install.nsi
deleted file mode 100644
index dfb0d65..0000000
--- a/os/windows/install.nsi
+++ /dev/null
@@ -1,97 +0,0 @@
-; example2.nsi
-;
-; This script is based on example1.nsi, but it remember the directory,
-; has uninstall support and (optionally) installs start menu shortcuts.
-;
-; It will install example2.nsi into a directory that the user selects,
-
-;--------------------------------
-
-; The name of the installer
-Name "YetiHack Installer"
-
-; The file to write
-OutFile "../../package/YetiHack_installer.exe"
-
-; The default installation directory
-InstallDir $PROGRAMFILES\YetiHack
-
-; Registry key to check for directory (so if you install again, it will
-; overwrite the old one automatically)
-InstallDirRegKey HKLM "Software\YetiHack" "Install_Dir"
-
-; Request application privileges for Windows Vista
-RequestExecutionLevel admin
-
-;--------------------------------
-
-; Pages
-
-Page components
-Page directory
-Page instfiles
-
-UninstPage uninstConfirm
-UninstPage instfiles
-
-;--------------------------------
-
-; The stuff to install
-Section "YetiHack"
-
- SectionIn RO
-
- SetOutPath $INSTDIR
- File "../../src/yetihack.exe"
- File "yetihack-windows/pdcurses.dll"
-
- ; Write the installation path into the registry
- WriteRegStr HKLM SOFTWARE\YetiHack "Install_Dir" "$INSTDIR"
-
- ; Write the uninstall keys for Windows
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YetiHack" "YetiHack Uninstaller" "YetiHack"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YetiHack" "UninstallString" '"$INSTDIR\uninstall.exe"'
- WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YetiHack" "NoModify" 1
- WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YetiHack" "NoRepair" 1
- WriteUninstaller "uninstall.exe"
-
-SectionEnd
-
-; Optional section (can be disabled by the user)
-Section "Start Menu Shortcuts"
-
- CreateDirectory "$SMPROGRAMS\YetiHack"
- CreateShortCut "$SMPROGRAMS\YetiHack\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
- CreateShortCut "$SMPROGRAMS\YetiHack\YetiHack.lnk" "$INSTDIR\YetiHack.exe" "" "$INSTDIR\YetiHack.exe" 0
-
-SectionEnd
-
-Section "Desktop Shortcut"
-
- CreateShortCut "$DESKTOP\YetiHack.lnk" "$INSTDIR\YetiHack.exe" "" "$INSTDIR\YetiHack.exe" 0
-
-SectionEnd
-
-;--------------------------------
-
-; Uninstaller
-
-Section "Uninstall"
-
- ; Remove registry keys
- DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YetiHack"
- DeleteRegKey HKLM SOFTWARE\YetiHack
-
- ; Remove files and uninstaller
- Delete $INSTDIR\*
- Delete $INSTDIR\uninstall.exe
-
- ; Remove shortcuts, if any
- Delete "$SMPROGRAMS\YetiHack\*.*"
- Delete "$DESKTOP\YetiHack.lnk"
-
- ; Remove directories used
- RMDir "$SMPROGRAMS\YetiHack"
- RMDir "$INSTDIR"
-
-SectionEnd
diff --git a/os/windows/yetihack-windows/pdcurses.dll b/os/windows/yetihack-windows/pdcurses.dll
deleted file mode 100644
index 550c7a2..0000000
--- a/os/windows/yetihack-windows/pdcurses.dll
+++ /dev/null
Binary files differ
diff --git a/src/YetiHack.cpp b/src/YetiHack.cpp
index d178ea3..129d759 100644
--- a/src/YetiHack.cpp
+++ b/src/YetiHack.cpp
@@ -25,10 +25,10 @@ along with YetiHack. If not, see <http://www.gnu.org/licenses/>.
#include <fstream>
#include <sstream>
#include <cmath>
-#ifdef LINUX
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef WINDOWS
+#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif
#include "yeti.h"
@@ -48,10 +48,10 @@ void intro();
void osleep(int miliseconds)
{
- #ifdef WINDOWS
+ #ifdef HAVE_WINDOWS_H
Sleep(miliseconds);
#endif
- #ifdef LINUX
+ #ifdef HAVE_UNISTD_H
usleep(miliseconds * 1000);
#endif
}