summaryrefslogtreecommitdiff
path: root/community/glpng/Makefile
blob: d6772798f242ca39440c4d0a370aa1bd1ed5a2f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
CFLAGS+=-fPIC -Iinclude
LDFLAGS+=-lpng -lGL
SHAREDLIBFLAGS=-shared
DESTDIR=/usr/local
LIB=lib

all: libglpng.a libglpng.so.1.45

libglpng.a: glpng.o
	ar rv $@ $<

libglpng.so.1.45: glpng.o
	gcc $(CFLAGS) $(SHAREDLIBFLAGS) -Wl,-soname=libglpng.so.1 -Wl,--whole-archive $< -Wl,--no-whole-archive $(LDFLAGS) -o $@

glpng.o: src/glpng.c
	gcc $(CFLAGS) -c $<

clean:
	rm glpng.o libglpng.*

install:
	for i in include include/GL $(LIB); do \
		install -m 755 -d $(DESTDIR)/$$i; \
	done
	install -p -m 644 include/GL/glpng.h $(DESTDIR)/include/GL
	install -m 755 libglpng.* $(DESTDIR)/$(LIB)
	ln -s libglpng.so.1.45 $(DESTDIR)/$(LIB)/libglpng.so.1
	ln -s libglpng.so.1.45 $(DESTDIR)/$(LIB)/libglpng.so

.PHONY: clean install