-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
executable file
·42 lines (34 loc) · 1.18 KB
/
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
# Predefined constants
CC = gcc
TARGET = file-tilemap
SRC_DIR = src
OBJ_DIR = obj
# -Wno-deprecated, -Wno-deprecated-declarations is just for gtk warnings for now (migration to GEGL)
CFLAGS = $(shell pkg-config --cflags gtk+-2.0) \
$(shell pkg-config --cflags gimp-2.0) \
-Wno-format-truncation \
-Wno-deprecated \
-Wno-deprecated-declarations
LFLAGS = $(shell pkg-config --libs glib-2.0) \
$(shell pkg-config --libs gtk+-2.0) \
$(shell pkg-config --libs gimp-2.0) \
$(shell pkg-config --libs gimpui-2.0)
# File definitions
SRC_FILES=$(wildcard $(SRC_DIR)/*.c)
OBJ_FILES=$(SRC_FILES:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
$(TARGET): $(OBJ_DIR) $(OBJ_FILES)
$(CC) $(OBJ_FILES) -o $(TARGET) $(LFLAGS)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
$(CC) -c $< -o $@ $(CFLAGS)
$(OBJ_DIR):
test -d $(OBJ_DIR) || mkdir -p $(OBJ_DIR)
clean:
rm -rf $(OBJ_DIR)
rm $(TARGET)
install:
# mkdir -p $(DESTDIR)$(exec_prefix)/lib/gimp/2.0/plug-ins
# cp $(TARGET) $(DESTDIR)$(exec_prefix)/lib/gimp/2.0/plug-ins
cp $(TARGET) ~/.config/GIMP/2.10/plug-ins/
uninstall:
# rm $(DESTDIR)$(exec_prefix)/lib/gimp/2.0/plug-ins/$(TARGET)
.PHONY: clean install uninstall