@@ -4,25 +4,38 @@ SRCS:=$(wildcard *.c snes/*.c) third_party/gl_core/gl_core_3_1.c third_party/opu
4
4
OBJS:=$(SRCS:%.c =%.o)
5
5
PYTHON: =/usr/bin/env python3
6
6
CFLAGS: =$(if $(CFLAGS ) ,$(CFLAGS ) ,-O2 -Werror)
7
-
8
7
CFLAGS: =${CFLAGS} $(shell sdl2-config --cflags) -DSYSTEM_VOLUME_MIXER_AVAILABLE=0
9
- LDFLAGS: =${LDFLAGS} $(shell sdl2-config --libs) -lm
8
+
9
+ ifeq (${OS},Windows_NT)
10
+ WINDRES: =windres
11
+ RES: =zelda3.res
12
+ SDLFLAGS: =-Wl,-Bstatic $(shell sdl2-config --static-libs)
13
+ else
14
+ SDLFLAGS: =$(shell sdl2-config --libs) -lm
15
+ endif
10
16
11
17
.PHONY : all clean clean_obj clean_gen
12
18
13
19
all : $(TARGET_EXEC ) tables/zelda3_assets.dat
14
- $(TARGET_EXEC ) : $(OBJS )
15
- $(CC ) $( OBJS ) -o $@ $(LDFLAGS )
20
+ $(TARGET_EXEC ) : $(OBJS ) $( RES )
21
+ $(CC ) $^ -o $@ $(LDFLAGS ) $( SDLFLAGS )
16
22
% .o : % .c
17
23
$(CC ) -c $(CFLAGS ) $< -o $@
18
24
25
+ $(RES ) : platform/win32/zelda3.rc
26
+ @echo " Generating Windows resources"
27
+ @$(WINDRES ) $< -O coff -o $@
28
+
19
29
tables/zelda3_assets.dat : tables/dialogue.txt
20
- cd tables; $(PYTHON ) compile_resources.py ../$(ROM )
30
+ @echo " Compiling game resources"
31
+ @cd tables; $(PYTHON ) compile_resources.py ../$(ROM )
21
32
tables/dialogue.txt :
22
- cd tables; $(PYTHON ) extract_resources.py ../$(ROM )
33
+ @echo " Extracting game resources"
34
+ @cd tables; $(PYTHON ) extract_resources.py ../$(ROM )
23
35
24
36
clean : clean_obj clean_gen
25
37
clean_obj :
26
- $(RM ) $(OBJS ) $(TARGET_EXEC )
38
+ @ $(RM ) $(OBJS ) $(TARGET_EXEC )
27
39
clean_gen :
28
- $(RM ) tables/zelda3_assets.dat
40
+ @$(RM ) $(RES ) tables/zelda3_assets.dat tables/* .txt tables/* .png tables/sprites/* .png tables/* .yaml
41
+ @rm -rf tables/__pycache__ tables/dungeon tables/img tables/overworld tables/sound
0 commit comments