Don't crash if somebody calls audioapi_get_voice with samples=NULL
[lsnes.git] / src / Makefile
blobb325ca92a1404925a0f0945bdf7a1539835283f0
1 __all_files__: util/__all_files__ \
2 lsnes$(DOT_EXECUTABLE_SUFFIX) \
3 $(patsubst %.cpp,%.util$(DOT_EXECUTABLE_SUFFIX),$(wildcard util/*.cpp))
5 ifndef NO_RDYNAMIC
6 LDFLAGS += -rdynamic
7 endif
8 ifdef NO_DLFCN
9 CFLAGS += -DNO_DLFCN
10 else
11 LDFLAGS += -ldl
12 endif
14 ifdef BOOST_FILESYSTEM3
15 CFLAGS += -DBOOST_FILESYSTEM3
16 endif
18 ifdef OPUS_CODEC
19 CFLAGS += -DWITH_OPUS_CODEC $(shell pkg-config --cflags opus)
20 LDFLAGS += $(shell pkg-config --libs opus)
21 endif
23 COMMON_LIBRARY=core lua fonts library interface video emulation
24 ALLFILES=__all__.files
25 ALLFLAGS=__all__.ldflags
26 COMMON_LIBRARY_FILES=$(patsubst %,%/$(ALLFILES),$(COMMON_LIBRARY))
27 COMMON_LIBRARY_FLAGS=$(patsubst %,%/$(ALLFLAGS),$(COMMON_LIBRARY))
28 PLATFORM_LIBRARY_FILES=platform/$(ALLFILES)
29 PLATFORM_LIBRARY_FLAGS=platform/$(ALLFLAGS)
31 __all_common__.files: $(COMMON_LIBRARY_FILES)
32 lua genfilelist.lua $^ >$@
34 __all_platform__.files: $(PLATFORM_LIBRARY_FILES)
35 lua genfilelist.lua $^ >$@
37 core/$(ALLFILES): forcelook
38 $(MAKE) -C core
40 emulation/$(ALLFILES): forcelook
41 $(MAKE) -C emulation
43 fonts/$(ALLFILES): forcelook
44 $(MAKE) -C fonts
46 library/$(ALLFILES): forcelook
47 $(MAKE) -C library
49 interface/$(ALLFILES): forcelook
50 $(MAKE) -C interface
52 lua/$(ALLFILES): forcelook
53 $(MAKE) -C lua
55 platform/$(ALLFILES): forcelook
56 $(MAKE) -C platform
58 util/__all_files__: forcelook
59 $(MAKE) -C util
61 util/%.$(OBJECT_SUFFIX): util/__all_files__
62 @true;
64 video/$(ALLFILES): forcelook
65 $(MAKE) -C video
67 .PRECIOUS: %.$(OBJECT_SUFFIX) util/%.$(OBJECT_SUFFIX) %.files
69 %.util$(DOT_EXECUTABLE_SUFFIX): %.$(OBJECT_SUFFIX) __all_common__.files
70 $(REALCC) -o $@ $< `cat __all_common__.files` $(LDFLAGS) `cat $(COMMON_LIBRARY_FLAGS)`
72 lsnes$(DOT_EXECUTABLE_SUFFIX): __all_common__.files __all_platform__.files
73 $(REALCC) -o $@ `cat __all_common__.files __all_platform__.files` $(LDFLAGS) `cat $(COMMON_LIBRARY_FLAGS) $(PLATFORM_LIBRARY_FLAGS)`
75 precheck:
76 $(MAKE) -C core precheck
77 $(MAKE) -C emulation precheck
78 $(MAKE) -C interface precheck
79 $(MAKE) -C library precheck
80 $(MAKE) -C lua precheck
81 $(MAKE) -C platform precheck
82 $(MAKE) -C util precheck
83 $(MAKE) -C video precheck
85 clean:
86 rm -f *.$(OBJECT_SUFFIX) *.ldflags
87 $(MAKE) -C core clean
88 $(MAKE) -C emulation clean
89 $(MAKE) -C fonts clean
90 $(MAKE) -C interface clean
91 $(MAKE) -C library clean
92 $(MAKE) -C lua clean
93 $(MAKE) -C platform clean
94 $(MAKE) -C util clean
95 $(MAKE) -C video clean
97 forcelook:
98 @true