eqemu
view libs/libimago/Makefile.in @ 12:2656099aff12
added copyright notices and license
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 18 Jul 2014 07:04:21 +0300 |
parents | |
children |
line source
1 dbg = -g
2 opt =
4 csrc = $(wildcard src/*.c)
5 obj = $(csrc:.c=.o)
6 lib_a = libimago.a
8 somajor = 2
9 sominor = 0
11 incdir = -I$(PREFIX)/include
12 libdir = -L$(PREFIX)/lib
14 ifeq ($(shell uname -s), Darwin)
15 lib_so = libimago.dylib
16 shared = -dynamiclib
17 # add macports and fink dirs to the include and lib paths
18 incdir += -I/opt/local/include -I/sw/local/include -I/usr/X11R6/include
19 libdir += -L/opt/local/lib -L/sw/local/lib -L/usr/X11R6/lib
20 else
21 soname = libimago.so.$(somajor)
22 lib_so = $(soname).$(sominor)
23 solink = libimago.so
24 shared = -shared -Wl,-soname,$(soname)
25 endif
27 ifeq ($(shell uname -s), IRIX)
28 # add nekoware and SGI freeware dirs to the include and lib paths
29 incdir += -I/usr/nekoware/include -I/usr/freeware/include
30 libdir += -L/usr/nekoware/lib -L/usr/freeware/lib
31 endif
33 CC = gcc
34 AR = ar
35 CFLAGS = -pedantic -Wall $(opt) $(dbg) -fPIC -Isrc $(incdir)
36 LDFLAGS = $(libdir) -lpng -lz -ljpeg -ldl
38 .PHONY: all
39 all: $(lib_a) $(lib_so)
41 $(lib_a): $(obj)
42 $(AR) rcs $@ $^
44 $(lib_so): $(obj)
45 $(CC) $(CFLAGS) $(shared) -o $@ $^ $(LDFLAGS)
47 .PHONY: clean
48 clean:
49 rm -f $(obj)
51 .PHONY: distclean
52 distclean:
53 rm -f $(obj) $(lib_so) $(lib_a) Makefile src/modules.c
55 .PHONY: install
56 install: $(lib_so) $(lib_a)
57 mkdir -p $(DESTDIR)$(PREFIX)/include $(DESTDIR)$(PREFIX)/lib
58 cp src/imago2.h $(DESTDIR)$(PREFIX)/include/imago2.h
59 cp $(lib_so) $(DESTDIR)$(PREFIX)/lib/$(lib_so)
60 cp $(lib_a) $(DESTDIR)$(PREFIX)/lib/$(lib_a)
61 [ -n "$(solink)" ] \
62 && cd $(DESTDIR)$(PREFIX)/lib \
63 && rm -f $(solink) $(soname) \
64 && ln -s $(lib_so) $(soname) \
65 && ln -s $(soname) $(solink) \
66 || true
68 .PHONY: uninstall
69 uninstall:
70 rm -f $(DESTDIR)$(PREFIX)/include/imago2.h
71 rm -f $(DESTDIR)$(PREFIX)/lib/$(lib_so)
72 rm -f $(DESTDIR)$(PREFIX)/lib/$(lib_a)
73 [ -n "$(solink)" ] \
74 && rm -f $(DESTDIR)$(PREFIX)/lib/$(solink) \
75 && rm -f $(DESTDIR)$(PREFIX)/lib/$(soname) \
76 || true