-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (33 loc) · 864 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
CC ?= gcc
PKGCONFIG = $(shell which pkg-config)
CFLAGS = -Wall -pedantic $(shell $(PKGCONFIG) --cflags gtk+-3.0)
LIBS = $(shell $(PKGCONFIG) --libs gtk+-3.0)
SRCDIR = src
OBJDIR = obj
SOURCES := $(wildcard $(SRCDIR)/*.c)
OBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
all: memoapp
#
# Generates src/ui-resources.c from the UI description files. Run this
# when building the project for the first time and when a UI file is changed.
#
gresources:
glib-compile-resources \
src/ui/memoapp.gresource.xml \
--target src/ui-resources.c \
--sourcedir=src \
--generate-source
$(OBJECTS): $(OBJDIR)/%.o: $(SRCDIR)/%.c
$(CC) $(CFLAGS) -c $< -o $@
@echo
@echo "SOURCES: $(SOURCES)"
@echo
memoapp: $(OBJECTS)
$(CC) -o $(@F) $(OBJECTS) $(LIBS)
@echo
@echo "OBJECTS: $(OBJECTS)"
@echo
clean:
rm -f $(OBJECTS)
rm -f memoapp
rm -f src/ui-resources.c