diff options
author | mitchell <70453897+667e-11@users.noreply.github.com> | 2012-08-01 13:32:22 -0400 |
---|---|---|
committer | mitchell <70453897+667e-11@users.noreply.github.com> | 2012-08-01 13:32:22 -0400 |
commit | f1be0e38d3a28328269fc1f219109513041690af (patch) | |
tree | 8e068de60aefe66d6586d1afa9e8283fccc8e6dd | |
parent | cb44f6df672e276324632d58a35648efc88ab783 (diff) |
Added 'install' and 'uninstall' rules; src/Makefile
-rw-r--r-- | doc/12_Compiling.md | 9 | ||||
-rw-r--r-- | src/Makefile | 17 |
2 files changed, 26 insertions, 0 deletions
diff --git a/doc/12_Compiling.md b/doc/12_Compiling.md index 7bcab5e6..e16aba01 100644 --- a/doc/12_Compiling.md +++ b/doc/12_Compiling.md @@ -73,6 +73,15 @@ CXXFLAGS="-I/usr/local/include -L/usr/local/lib"` if the prefix where any dependencies are installed is `/usr/local` and your compiler flags do not include them by default. +#### Installing + +Textadept is self-contained, meaning it does not need to be installed and can be +run from wherever it is located. However, if you want to install Textadept like +a normal Linux application, run the usual `make` and then `make install` or +`sudo make install` depending on your privilages. The default prefix is +`/usr/local` but you can change this by setting `DESTDIR` (e.g. `make install +DESTDIR=/prefix/to/install/to`). + ### Cross Compiling for Windows When cross-compiling from within Linux, first unzip the GTK+ for Windows bundle diff --git a/src/Makefile b/src/Makefile index f1eecb2a..ae2b002c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -67,6 +67,10 @@ ifneq (, $(or $(findstring Linux, $(kernel)), $(findstring BSD, $(kernel)))) endif MAKE = gmake endif + DESTDIR = /usr/local + + bin_dir = $(DESTDIR)/bin + data_dir = $(DESTDIR)/share/textadept ifneq (ncurses, $(MAKECMDGOALS)) plat_flag = -DGTK @@ -287,6 +291,19 @@ textadeptjit.osx: textadeptjit; mv ../$< ../$@ textadept-ncurses.osx: textadept-ncurses; mv ../$< ../$@ textadeptjit-ncurses.osx: textadeptjit-ncurses; mv ../$< ../$@ +# Install/uninstall. + +install: ../textadept ../textadeptjit ../textadept-ncurses \ + ../textadeptjit-ncurses | ../core ../doc ../init.lua ../lexers \ + ../LICENSE ../modules ../themes + install -d $(bin_dir) $(data_dir) + install $^ $(data_dir) + cp -r $| $(data_dir) + ln -s $(subst .., $(data_dir), $^) $(bin_dir) +uninstall: + rm $(bin_dir)/textadept* + rm -r $(data_dir) + # Clean. mostlyclean: |