Browse Source

add installation in Makefile (and update README.md)

Thibaut Marty 9 years ago
parent
commit
87b1f3972e
2 changed files with 10 additions and 5 deletions
  1. 6 2
      Makefile
  2. 4 3
      README.md

+ 6 - 2
Makefile

@@ -20,19 +20,23 @@ SRCS=time.c parser.c printer.c main.c
 CC=gcc
 CFLAGS=
 LIBS=$(shell pkg-config --cflags --libs x11) -lrt
+INSTALL_DIR=/usr/local/bin
 
 OBJS = $(SRCS:.c=.o)
 
 default: subtitlesPrinter
 
 subtitlesPrinter: $(OBJS)
-	$(CC) -o subtitlesPrinter $^ $(CFLAGS) $(LIBS) 
+	$(CC) -o subtitlesPrinter $^ $(CFLAGS) $(LIBS)
 
 %.o: %.c
 	$(CC) -c -o $@ $< $(CFLAGS)
 
+install: subtitlesPrinter
+	install --mode=755 subtitlesPrinter $(INSTALL_DIR)
+
 .PHONY: clean default
 
 clean:
-	rm -f *.o
+	rm -f *.o subtitlesPrinter
 

+ 4 - 3
README.md

@@ -15,13 +15,14 @@ Run in a terminal
 ```bash
 git clone https://github.com/OlivierMarty/SubtitlesPrinter.git
 make
+sudo make install
 ```
 
 ## Usage
 
-To show file.srt, run in the installation directory :
+To show file.srt, run in a terminal :
 ```bash
-./subtitlesPrinter file.srt
+subtitlesPrinter file.srt
 ```
 
 To quit, press CTRL+C in the terminal.
@@ -30,7 +31,7 @@ To quit, press CTRL+C in the terminal.
 
 It is possible to skip x seconds, or to change the delay before starting. For other parameters and details see
 ```bash
-./subtitlesPrinter -h
+subtitlesPrinter -h
 ```
 
 ## TODO