about summary refs log tree commit diff
path: root/Makefile
blob: 3fb7ded206c429dde2633610515db3becd2747ea (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
31
32
33
34
35
36
37
38
39
40
41
42
43
include config.mk

CFLAGS += $(shell MagickWand-config --cflags)
CFLAGS += -std=c99

LDFLAGS += $(shell MagickWand-config --ldflags --libs)

RM = rm -f
SRCDIR = src
OBJDIR = obj
OBJS = cpetpet.o

all: cpetpet.a cpetpet.so

$(OBJS): config.h cpetpet.h

cpetpet.a cpetpet.so: $(OBJS)

cpetpet.so:
	cc -shared -o $@ ${LDFLAGS} ${LDLIBS} $^

cpetpet.a:
	ar rcs $@ $^

install: all
	install -d $(DESTDIR)/lib $(DESTDIR)/share/cpetpet
	install -m644 cpetpet.a $(DESTDIR)/lib
	install -m755 cpetpet.so $(DESTDIR)/lib
	install -m644 share/cpetpet/* $(DESTDIR)/share/cpetpet
	install -m644 cpetpet.h $(DESTDIR)/include

uninstall:
	$(RM) -r $(DESTDIR)/share/cpetpet
	$(RM) $(DESTDIR)/lib/cpetpet.{a,so}
	$(RM) $(DESTDIR)/include/cpetpet.h

clean:
	$(RM) *.a *.o *.so

cleanall: clean
	$(RM) config.* config.*

.PHONY: all clean cleanall install uninstall