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