aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 2b16b1ff2cb25a46e5b4deb225f5c0c1ab1c8963 (plain)
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
B = build/default/

C = c/main.c
PL = pl/track_episodes.pl pl/local_episodes.pl pl/episode_data.pl
OBJ = $(B)common.obj $(B)datalistview.obj $(B)episodelistview.obj $(B)listview.obj $(B)resource.obj

CC = swipl-ld
CFLAGS += -DUNICODE -D_UNICODE
LDFLAGS += -lcomctl32 -luxtheme

ifeq ($(BUILD_MODE),debug)
	CFLAGS += -g
else
	CFLAGS += -O -ld-options,-mwindows
endif

all: $(B)EpisodeBrowser.exe

$(B)EpisodeBrowser.exe: $(C) $(OBJ) $(PL) c/defs.h Makefile
	$(CC) -v $(CFLAGS) $(LDFLAGS) -goal true -o $@ $(C) $(OBJ) $(PL)

$(B)resource.obj: c/resource.h c/resource.rc
	windres -i c/resource.rc -o $(B)resource.obj

$(B)%.obj: c/%.c c/defs.h
	$(CC) -c $(CFLAGS) -o $@ $<

TAGS: c/*.c c/*.h
	etags $^

clean:
	rm -fr $(B)EpisodeBrowser.exe $(B)*.obj