-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile
47 lines (36 loc) · 1007 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
41
42
43
44
45
46
47
# The Makefile is only for building the osdialog test binary.
# You don't need to use it for your application, but it might be helpful for suggesting compiler flags.
CFLAGS = -g -Wall -Wextra -std=c99 -pedantic
SOURCES = test.c
ifndef ARCH
$(error ARCH is not defined. Run with `make ARCH=mac`, win, gtk2, gtk3, or zenity)
endif
SOURCES += osdialog.c
ifeq ($(ARCH),gtk2)
CFLAGS += $(shell pkg-config --cflags gtk+-2.0)
LDFLAGS += $(shell pkg-config --libs gtk+-2.0)
SOURCES += osdialog_gtk2.c
endif
ifeq ($(ARCH),gtk3)
CFLAGS += $(shell pkg-config --cflags gtk+-3.0)
LDFLAGS += $(shell pkg-config --libs gtk+-3.0)
SOURCES += osdialog_gtk3.c
endif
ifeq ($(ARCH),win)
LDFLAGS += -lcomdlg32
SOURCES += osdialog_win.c
endif
ifeq ($(ARCH),mac)
LDFLAGS += -framework AppKit
SOURCES += osdialog_mac.m
CFLAGS += -mmacosx-version-min=10.7
endif
ifeq ($(ARCH),zenity)
SOURCES += osdialog_zenity.c
endif
test: $(SOURCES)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
run: test
./$^
clean:
rm -rfv test