Browse Source

Merge pull request #1 from ThibautMarty/installation

add installation in Makefile (and update README.md)
Olivier Marty 9 years ago
parent
commit
f95e9acf2d
2 changed files with 11 additions and 6 deletions
  1. 7 3
      Makefile
  2. 4 3
      README.md

+ 7 - 3
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)
 
-.PHONY: clean default
+install: subtitlesPrinter
+	install --mode=755 subtitlesPrinter $(INSTALL_DIR)
+
+.PHONY: clean default install
 
 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