Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a.out
hexitor.o
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
DESTDIR?=/usr/bin
LDIR?=/usr

default: build

build:
gcc -Wall main.c -lncurses -ltinfo
gcc -Wall -I$(LDIR)/include -I$(LDIR)/include/ncurses main.c -o hexitor.o -L$(LDIR)/lib -lncurses -ltinfo

install:
mkdir -p ${DESTDIR}/usr/bin
cp a.out ${DESTDIR}/usr/bin/hexitor
@echo "Installing in ${DESTDIR}"
mkdir -p ${DESTDIR}
cp hexitor.o ${DESTDIR}/hexitor

uninstall:
rm ${DESTDIR}/usr/bin/hexitor
rm ${DESTDIR}/hexitor

clean:
rm -f a.out
rm -f hexitor.o
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,35 @@ To uninstall:
sudo make uninstall
```

# Installation without root

If you don't have root access and there is not libncurses installed,
first install ncurses

```bash
wget https://invisible-mirror.net/archives/ncurses/ncurses-6.2.tar.gz
tar -xzf ncurses-6.2.tar.gz
cd ncurses-6.2
./configure --prefix=$HOME/ncurses
make
make install
cd ..
rm -rf ncurses-6.2*
```

Then compile and install hexitor

```bash
make LDIR=$HOME/ncurses
make DESTDIR=$HOME/bin install
```

to uninstall

```bash
make DESTDIR=$HOME/bin uninstall
```

# Usage

### Opening a file
Expand Down
Loading