Add idump
[sgilles-overlay.git] / media-gfx / idump / files / 0001-Make-Makefile-portable.patch
blob01366b4fe4f8731df9d2ed8c8a3de51ca0ee95f3
1 From 33f323145361f35924ef814e9c9b0a5366e73ad1 Mon Sep 17 00:00:00 2001
2 From: "S. Gilles" <sgilles@math.umd.edu>
3 Date: Sun, 8 Jan 2017 17:37:26 +0000
4 Subject: [PATCH] Make Makefile portable
6 ---
7 makefile | 19 +++++++++++++------
8 1 file changed, 13 insertions(+), 6 deletions(-)
10 diff --git a/makefile b/makefile
11 index 96b95fb..e89a15e 100644
12 --- a/makefile
13 +++ b/makefile
14 @@ -1,17 +1,24 @@
15 -CC ?= gcc
16 -LDFLAGS ?= -lpng -ljpeg -L/usr/local/lib
17 -CFLAGS ?= -Wall -Wextra -std=c99 -pedantic \
18 - -O3 -pipe -s \
19 - -I/usr/local/include
20 +LDFLAGS ?=
21 +CFLAGS ?=
23 +CFLAGS+= -std=c99 $(shell pkg-config --cflags libpng libjpeg)
24 +LDFLAGS+= $(shell pkg-config --libs libpng libjpeg)
26 HDR = stb_image.h libnsgif.h libnsbmp.h
27 SRC = libnsgif.c libnsbmp.c
28 DST = idump
30 +PREFIX ?= /usr
31 +BINDIR ?= $(PREFIX)/bin
33 all: $(DST)
35 idump: idump.c $(HDR) $(SRC)
36 - $(CC) $(CFLAGS) $(LDFLAGS) $(SRC) $< -o $@
37 + $(CC) $(CFLAGS) $(SRC) $< -o $@ $(LDFLAGS)
39 clean:
40 rm -f $(DST)
42 +install: idump
43 + mkdir -p $(DESTDIR)$(BINDIR)
44 + cp -f idump $(DESTDIR)$(BINDIR)
45 \ No newline at end of file
46 --
47 2.11.0