-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (65 loc) · 2.29 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
PROGRAM = bubblegum
APP_VERSION = 0.13.1
BUILD_DIR = build
ifndef VALAC
VALAC := valac
endif
PACKAGES = glib-2.0 \
gee-1.0 \
gio-2.0 \
gstreamer-0.10 \
json-glib-1.0
VALAFLAGS = -g \
--thread \
--enable-checking \
--target-glib=2.32 \
--pkg=curses \
--enable-experimental
VALA_FILES = main.vala \
Resources.vala \
App.vala \
\
Core/EventLog.vala \
Core/Config.vala \
Core/PlaybackManager.vala \
Core/AudioPlayer.vala \
\
Models/MediaItem.vala \
Models/Playlist.vala \
\
UI/Window.vala \
UI/View.vala \
UI/Layout.vala \
UI/LayoutManager.vala \
UI/InputManager.vala \
UI/GFX.vala \
\
UI/StatusView.vala \
UI/PlaylistView.vala \
UI/LogView.vala \
CFLAGS = -lncursesw -O2 -g -pipe -w -lm
VALA_CFLAGS := `pkg-config --cflags $(PACKAGES) gthread-2.0`
VALA_LDFLAGS := `pkg-config --libs $(PACKAGES) gthread-2.0`
VALA_STAMP := $(BUILD_DIR)/.stamp
EXPANDED_VALA_FILES := $(foreach src,$(VALA_FILES),src/$(src))
EXPANDED_C_FILES := $(foreach file,$(subst src,$(BUILD_DIR),$(EXPANDED_VALA_FILES)),$(file:.vala=.c))
EXPANDED_O_FILES := $(foreach file,$(subst src,$(BUILD_DIR),$(EXPANDED_VALA_FILES)),$(file:.vala=.o))
all: $(PROGRAM)
$(VALA_STAMP):
@mkdir -p $(BUILD_DIR)
@$(VALAC) --ccode --directory=$(BUILD_DIR) --basedir=src \
$(foreach pkg,$(PACKAGES),--pkg=$(pkg)) \
$(VALAFLAGS) \
$(EXPANDED_VALA_FILES)
@touch $@
$(EXPANDED_C_FILES): $(VALA_STAMP)
@
$(EXPANDED_O_FILES): %.o: %.c Makefile
@$(CC) -c $(VALA_CFLAGS) $(CFLAGS) -o $@ $<
$(PROGRAM): $(EXPANDED_O_FILES)
@$(CC) $(EXPANDED_O_FILES) $(CFLAGS) $(VALA_LDFLAGS) -o $@
clean:
@rm -f $(EXPANDED_O_FILES)
@rm -f $(EXPANDED_C_FILES)
@rm -f $(VALA_STAMP)
@rm -f $(PROGRAM)