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
7 makefile | 19 +++++++++++++------
8 1 file changed, 13 insertions(+), 6 deletions(-)
10 diff --git a/makefile b/makefile
11 index 96b95fb..e89a15e 100644
16 -LDFLAGS ?= -lpng -ljpeg -L/usr/local/lib
17 -CFLAGS ?= -Wall -Wextra -std=c99 -pedantic \
19 - -I/usr/local/include
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
31 +BINDIR ?= $(PREFIX)/bin
35 idump: idump.c $(HDR) $(SRC)
36 - $(CC) $(CFLAGS) $(LDFLAGS) $(SRC) $< -o $@
37 + $(CC) $(CFLAGS) $(SRC) $< -o $@ $(LDFLAGS)
43 + mkdir -p $(DESTDIR)$(BINDIR)
44 + cp -f idump $(DESTDIR)$(BINDIR)
45 \ No newline at end of file