-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (30 loc) · 962 Bytes
/
Makefile
File metadata and controls
39 lines (30 loc) · 962 Bytes
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
CC := cc
CFLAGS := -std=c11 -Wall -Wextra -Wpedantic -g
PKG_CONFIG := pkg-config
PKGS := gtk+-3.0 gdk-pixbuf-2.0
CPPFLAGS := $(shell $(PKG_CONFIG) --cflags $(PKGS)) -Iinclude
LDFLAGS := $(shell $(PKG_CONFIG) --libs $(PKGS)) -lm
TARGET := preditor
SRCS := src/main.c src/app.c
OBJS := $(SRCS:.c=.o)
PREFIX ?= /usr
DESTDIR ?=
BINDIR := $(DESTDIR)$(PREFIX)/bin
APPDIR := $(DESTDIR)$(PREFIX)/share/applications
DOCDIR := $(DESTDIR)$(PREFIX)/share/doc/preditor
.PHONY: all clean debug release install
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)
src/%.o: src/%.c include/app.h
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
debug: CFLAGS += -O0 -DDEBUG
debug: clean all
release: CFLAGS += -O2 -DNDEBUG
release: clean all
install: $(TARGET)
install -Dm755 $(TARGET) $(BINDIR)/preditor
install -Dm644 packaging/preditor.desktop $(APPDIR)/preditor.desktop
install -Dm644 README.md $(DOCDIR)/README.md
clean:
rm -f $(OBJS) $(TARGET)