-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·38 lines (29 loc) · 961 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
RM := rm
MKDIR := mkdir
CD := cd
DIR_DELIM := /
CC=gcc
GTKLIBS=`pkg-config --libs gtk+-3.0`
GTKFLAGS=`pkg-config --cflags gtk+-3.0`
LIBS=-ldl
PLUGFLAGS=`pkg-config --cflags glib-2.0` `pkg-config --libs glib-2.0`
DEVFLAGS=-ggdb
SHAREDFLAGS=-pie -shared
.DEFAULT_TARGET: all
PLUGIN_SOURCES := $(wildcard src${DIR_DELIM}plugins${DIR_DELIM}*.c)
PLUGIN_DLLS := $(patsubst src/plugins/%.c, bin${DIR_DELIM}plugs${DIR_DELIM}%.so, ${PLUGIN_SOURCES})
all: dev plugins
dev: bin/ligma-dev
plugins: ${PLUGIN_DLLS}
bin/ligma-dev: uiobjects logicobjects
${CC} $(wildcard bin${DIR_DELIM}*.o) src${DIR_DELIM}main.c ${GTKFLAGS} ${DEVFLAGS} -o bin${DIR_DELIM}ligma-dev ${GTKLIBS} ${LIBS}
uiobjects: src/ui/Makefile
cd src/ui && ${MAKE}
logicobjects: src/logic/Makefile
cd src/logic && ${MAKE}
bin/plugs/%.so: src/plugins/%.c
${CC} $^ ${DEVFLAGS} ${SHAREDFLAGS} ${PLUGFLAGS} -o $@
clean:
${RM} -r bin
${MKDIR} bin
${MKDIR} bin${DIR_DELIM}plugs