-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile
44 lines (30 loc) · 798 Bytes
/
makefile
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 commands.mk
OPTS := -O3
CFLAGS := -std=c99 $(OPTS) $(shell pkg-config libheif --cflags) -fPIC -Wall
LDFLAGS := $(shell imlib2-config --libs) $(shell pkg-config libheif --libs)
SRC = $(wildcard *.c)
OBJ = $(foreach obj, $(SRC:.c=.o), $(notdir $(obj)))
DEP = $(SRC:.c=.d)
LIBDIR ?= $(shell pkg-config --variable=libdir imlib2)
LOADERDIR ?= $(LIBDIR)/imlib2/loaders/
ifndef DISABLE_DEBUG
CFLAGS += -ggdb
endif
.PHONY: all clean
all: heic.so
heic.so: $(OBJ)
$(CC) -shared -o $@ $^ $(LDFLAGS)
cp $@ $@.debug
strip $@
%.o: %.c
$(CC) -Wp,-MMD,$*.d -c $(CFLAGS) -o $@ $<
clean:
$(RM) $(DEP)
$(RM) $(OBJ)
$(RM) heic.so
install:
$(INSTALL_DIR) $(DESTDIR)$(LOADERDIR)
$(INSTALL_LIB) heic.so $(DESTDIR)$(LOADERDIR)
uninstall:
$(RM) $(PLUGINDIR)/heic.so
-include $(DEP)