Skip to content

Commit d65dd5f

Browse files
committed
Add install and uninstall targets and update readme
1 parent a7a7c6a commit d65dd5f

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,16 @@ TOURNAMENT_OBJECTS := $(TOURNAMENT_SOURCES:$(TOURNAMENT_SRC_DIR)/%.f=$(TOURNAMEN
2525

2626
rm = rm -rf
2727

28-
.PHONY: all clean remove
29-
all: $(BIN_DIR)/$(EXECUTABLE)
28+
.PHONY: all install uninstall clean remove
29+
all: $(BIN_DIR)/$(EXECUTABLE)
30+
31+
install: $(BIN_DIR)/$(EXECUTABLE)
32+
install -m 0755 $(BIN_DIR)/$(LIBRARY) /usr/local/lib
33+
install -m 0755 $(BIN_DIR)/$(EXECUTABLE) /usr/local/bin
34+
35+
uninstall:
36+
rm /usr/local/lib/$(LIBRARY)
37+
rm /usr/local/bin/$(EXECUTABLE)
3038

3139
# Link the tournament object files and the strategies shared object file to create the executable
3240
$(BIN_DIR)/$(EXECUTABLE): $(TOURNAMENT_OBJECTS) $(BIN_DIR)/$(LIBRARY)

README.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,20 @@ Clone the repository and compile the Fortran code::
6161
You should now have a `bin` directory containing the the executable file,
6262
`tourexec`, which you can run::
6363

64-
$ cd bin
65-
$ ./tourexec
64+
$ bin/tourexec
65+
66+
You can also chose to install the executable (and the associated library file)
67+
to standard locations on your local machine::
68+
69+
$ make install
70+
71+
The executable can now be run without having to specify its location::
72+
73+
$ tourexec
74+
75+
To remove both the executable and the libary from your machine, use::
76+
77+
$ make uninstall
6678

6779
Cleanup
6880
-------
@@ -72,7 +84,7 @@ Compiling the executable file will create some intermediary object files in an
7284

7385
$ make clean
7486

75-
There is also a command to remove the executable itself as well as the object
87+
There is also a command to remove the `bin` directory as well as the object
7688
files::
7789

7890
$ make remove

0 commit comments

Comments
 (0)