Compare commits

...

2 Commits

Author SHA1 Message Date
58be3215f9 Updated Makefile to use PDCurses install script 2022-10-25 08:08:08 -05:00
3c5d9176b0 Added install script for PDCurses 2022-10-25 08:07:48 -05:00
2 changed files with 40 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ full:
pdcurses: pdcurses:
make program3-4-pdcurses make program3-4-pdcurses
program3-4-pdcurses: program3-4.c texted.c fileman.c program3-4-pdcurses: program3-4.c texted.c fileman.c
./installpdcurses.sh
sed -i 's/<ncurses.h>/"pdcurses\/curses.h"/g' texted.h sed -i 's/<ncurses.h>/"pdcurses\/curses.h"/g' texted.h
sed -i 's/<ncurses.h>/"pdcurses\/curses.h"/g' fileman.h sed -i 's/<ncurses.h>/"pdcurses\/curses.h"/g' fileman.h
sed -i 's/for (int i=0,a=0;i<numCharsToPrint;i++,a++)/for (int i=0,a=0;i<numCharsToPrint-1;i++,a++)/g' program3-4.c sed -i 's/for (int i=0,a=0;i<numCharsToPrint;i++,a++)/for (int i=0,a=0;i<numCharsToPrint-1;i++,a++)/g' program3-4.c

39
installpdcurses.sh Executable file
View File

@@ -0,0 +1,39 @@
#!/bin/bash
FILE=/lib/libncursest.so
work_dir="${PWD}"
cores="$(nproc)"
curses_url="https://github.com/wmcbrine/PDCurses.git"
mkdir pdcurses
git clone "${curses_url}" pdcurses
echo "Fetched pdcurses source code from ${curses_url}..."
cd pdcurses/sdl2 || exit
echo "Running make..."
make -j"${cores}" > /dev/null
echo "PDCurses has been compiled, and will be linked statically."
# cd lib || exit
# FILE=libncursest.so.?.?
# if ls /lib/${FILE} 1> /dev/null 2>&1 ; then
# echo "You have a version of ncurses that was identical to the one that was compiled."
# echo " Quitting..."
# exit
# else
# echo "You have a different version of ncurses than the one that was just compiled."
# read -p "Would you like to install the new version? [y/N] " userchoice
#
#
# if [ "$userchoice" = "Y" ]; then
# echo "The program will now attempt to install the new version of ncurses (the one that was just compiled). In order to do this, the sudo password is required."
# echo "Installing the new version of ncurses..."
# sudo make install
# echo "The new version has been installed. The program will now quit."
# echo "Quitting..."
# exit
#
# else
# echo "You chose to not install the new ncurses version. This program will now quit."
# echo "Quitting..."
# exit
# fi
# fi