From a4259b506c030db954c57c4129cb01d69df67779 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Fri, 6 Nov 2015 16:57:40 +0000 Subject: Add install target to makefile --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a1e80b7..6456194 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,18 @@ -.PHONY: clean +.PHONY: clean install + +prefix = /usr CFLAGS = -g -W -Wall -std=c11 `sdl2-config --cflags` LDFLAGS = `sdl2-config --libs` -lfreeimage TARGET = imv -SOURCES = $(wildcard *.c) -OBJECTS = $(SOURCES:%.c=%.o) +OBJECTS = main.o $(TARGET): $(OBJECTS) $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) clean: $(RM) $(TARGET) $(OBJECTS) + +install: $(TARGET) + install -m 0755 $(TARGET) $(prefix)/bin -- cgit v1.2.3