-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
41 lines (28 loc) · 805 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
LD := $(CC)
# Glib/GObject/Gio includes and libraries
GLIB_CFLAGS := $(shell pkg-config --cflags glib-2.0 gobject-2.0 gio-2.0)
GLIB_LDFLAGS := $(shell pkg-config --libs glib-2.0 gobject-2.0 gio-2.0)
CFLAGS := -fvisibility=hidden -fPIC -std=c99 -Wall -g $(GLIB_CFLAGS) -DG_LOG_DOMAIN=\"sooshi\" -DSOOSHI_DLL -DSOOSHI_DLL_EXPORTS
LDFLAGS := $(GLIB_LDFLAGS)
TARGET := libsooshi.so
SOURCES := $(wildcard src/*.c)
OBJECTS := $(SOURCES:.c=.o)
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(LD) -shared -o $@ $^ $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) -c $^ -o $@
run: $(TARGET)
G_MESSAGES_DEBUG=all ./$(TARGET)
clean:
rm -rf $(TARGET) $(OBJECTS)
rm -rf doc/html
tests:
make -C tests/
./tests/test
examples:
make -C example/
doc: $(SOURCES)
doxygen doc/Doxyfile
.PHONY: doc examples tests