Skip to content

Commit efae310

Browse files
committed
Fix libretro-imageviewer standalone compilation
1 parent ace9c9f commit efae310

1 file changed

Lines changed: 43 additions & 21 deletions

File tree

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,43 @@
1-
image_core.so: image_core.c
2-
gcc \
3-
-g \
4-
-DHAVE_STB_IMAGE \
5-
image_core.c \
6-
-I../../libretro-common/include/ \
7-
-I../../deps/stb/ \
8-
../../libretro-common/compat/compat_strcasestr.c \
9-
../../libretro-common/compat/compat_strl.c \
10-
../../libretro-common/file/file_path.c \
11-
../../libretro-common/file/file_path_io.c \
12-
../../libretro-common/file/retro_dirent.c \
13-
../../libretro-common/lists/dir_list.c \
14-
../../libretro-common/lists/string_list.c \
15-
../../libretro-common/streams/file_stream.c \
16-
../../libretro-common/vfs/vfs_implementation.c \
17-
-shared \
18-
-fPIC \
19-
-Wl,--no-undefined \
20-
-lm \
21-
-o image_core.so
1+
CC ?= gcc
2+
CFLAGS ?= -g
3+
LDFLAGS ?=
4+
5+
ifneq ($(SANITIZER),)
6+
CFLAGS := -fsanitize=$(SANITIZER) -fno-omit-frame-pointer $(CFLAGS)
7+
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
8+
endif
9+
10+
SOURCES := \
11+
image_core.c \
12+
../../libretro-common/compat/compat_strcasestr.c \
13+
../../libretro-common/compat/compat_strl.c \
14+
../../libretro-common/compat/fopen_utf8.c \
15+
../../libretro-common/encodings/encoding_utf.c \
16+
../../libretro-common/file/file_path.c \
17+
../../libretro-common/file/file_path_io.c \
18+
../../libretro-common/file/retro_dirent.c \
19+
../../libretro-common/lists/dir_list.c \
20+
../../libretro-common/lists/string_list.c \
21+
../../libretro-common/streams/file_stream.c \
22+
../../libretro-common/time/rtime.c \
23+
../../libretro-common/vfs/vfs_implementation.c
24+
25+
INCLUDES := \
26+
-I../../libretro-common/include/ \
27+
-I../../deps/stb/
28+
29+
DEFINES := -DHAVE_STB_IMAGE
30+
31+
TARGET := image_core.so
32+
33+
all: $(TARGET)
34+
35+
$(TARGET): $(SOURCES)
36+
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) $(SOURCES) \
37+
-shared -fPIC -Wl,--no-undefined -lm \
38+
$(LDFLAGS) -o $(TARGET)
39+
40+
clean:
41+
rm -f $(TARGET)
42+
43+
.PHONY: all clean

0 commit comments

Comments
 (0)