Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add install and uninstall targets to Makefile #72

Merged
merged 9 commits into from
Jun 3, 2022
Merged
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: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
root
orig
*.IMG
real-ld
Expand All @@ -13,5 +12,4 @@ binutils-*
drawtest
*.a
keymap/keymap
keymaps
share
23 changes: 22 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ LDFLAGS = $(CFLAGS) -lc -B. -Wl,-b,$(BFD_OUT_TARGET) -no-pie
LDLIBS = -lncurses -ltinfo -lm
PATH := .:$(PATH)
KEYMAPS = xterm rxvt-unicode-256color xterm-256color $(TERM)
prefix = /usr/local

define BFD_TARGET_ERROR
Your version of binutils was compiled without coff-i386 target support.
Expand All @@ -17,7 +18,7 @@ endef

export BFD_TARGET_ERROR

.PHONY: clean check distclean
.PHONY: clean check distclean install uninstall

all: check 123 keymaps
@file 123
Expand Down Expand Up @@ -74,3 +75,23 @@ distclean: clean
./gzip.sh clean
./binutils.sh clean
./extract.sh clean

install: all
install -Dm 755 "bin/123" "$(prefix)/bin/123"
install -Dm 644 "share/man/man1/123.1" "$(prefix)/share/man/man1/123.1"
install -Dm 644 "share/lotus/etc/l123set.cf" "$(prefix)/share/lotus/etc/l123set.cf"
find "share/lotus/keymaps" -type f -exec install -Dm 644 {} "$(prefix)/{}" \;
install -Dm 644 "share/lotus/123.v10/sysV386/lotus.bcf" "$(prefix)/share/lotus/123.v10/sysV386/lotus.bcf"
install -Dm 644 "share/lotus/123.v10/sysV386/lib/wyse50-lts123" "$(prefix)/share/lotus/123.v10/sysV386/lib/wyse50-lts123"
find "share/lotus/123.v10/cbd" -type f -exec install -Dm 644 {} "$(prefix)/{}" \;
find "share/lotus/123.v10/fonts" -type f -exec install -Dm 644 {} "$(prefix)/{}" \;
find "share/lotus/123.v10/hlp" -type f -exec install -Dm 644 {} "$(prefix)/{}" \;
find "share/lotus/123.v10/keymaps" -type f -exec install -Dm 644 {} "$(prefix)/{}" \;
find "share/lotus/123.v10/pbd" -type f -exec install -Dm 644 {} "$(prefix)/{}" \;
find "share/lotus/123.v10/ri" -type f -exec install -Dm 644 {} "$(prefix)/{}" \;
find "share/lotus/123.v10/smpfiles" -type f -exec install -Dm 644 {} "$(prefix)/{}" \;

uninstall:
$(RM) "$(prefix)/bin/123"
$(RM) "$(prefix)/share/man/man1/123.1"
$(RM) -r "$(prefix)/share/lotus"
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,17 @@ When that's complete, copy `objcopy` and `objdump` from the `binutils` directory

The Makefile should automatically use the new binaries, and continue to build.

## Installing

Run `make install` to install into `/usr/local`.

Run `make install prefix=/my/prefix` to install into a custom prefix.

Run `make uninstall` or `make uninstall prefix=/my/prefix` to uninstall.

## Running

Just run `./123`.
Just run `./123` in the project directory after building, or, if you installed it, run `123`.

### Getting Started

Expand Down