8 include $(CWD
)/Makefile.mk
10 # ---------------------------------------------------------------------------------------------------------------------
12 BINDIR
:= $(CWD
)/..
/bin
15 OBJDIR
:= $(CWD
)/..
/build
/tests
/Debug
16 MODULEDIR
:= $(CWD
)/..
/build
/modules
/Debug
18 OBJDIR
:= $(CWD
)/..
/build
/tests
/Release
19 MODULEDIR
:= $(CWD
)/..
/build
/modules
/Release
22 # ---------------------------------------------------------------------------------------------------------------------
24 BASE_FLAGS
+= -DBUILDING_CARLA
25 BASE_FLAGS
+= -I.
-I..
-I..
/backend
-I..
/includes
-I..
/modules
-I..
/utils
26 BUILD_CXX_FLAGS
+= -I
$(CWD
)/modules
28 # ---------------------------------------------------------------------------------------------------------------------
30 PEDANTIC_FLAGS
= -pedantic
-pedantic-errors
31 PEDANTIC_FLAGS
+= -Wall
-Wextra
-Werror
-pipe
33 PEDANTIC_FLAGS
+= -Wabi
=98 -Wcast-qual
-Wclobbered
-Wconversion
-Wdisabled-optimization
34 PEDANTIC_FLAGS
+= -Wcast-align
-Wcast-qual
-Wclobbered
-Wconversion
-Wdisabled-optimization
35 PEDANTIC_FLAGS
+= -Wdouble-promotion
-Wfloat-equal
-Wlogical-op
-Wpointer-arith
-Wsign-conversion
36 PEDANTIC_FLAGS
+= -Wformat
=2 -Woverlength-strings
37 PEDANTIC_FLAGS
+= -Wformat-truncation
=2 -Wformat-overflow
=2
38 PEDANTIC_FLAGS
+= -Wstringop-overflow
=4
39 PEDANTIC_FLAGS
+= -Wmissing-declarations
-Wredundant-decls
40 PEDANTIC_FLAGS
+= -Wshadow
-Wundef
-Wuninitialized
-Wunused
41 PEDANTIC_FLAGS
+= -Wstrict-aliasing
-fstrict-aliasing
42 PEDANTIC_FLAGS
+= -Wstrict-overflow
-fstrict-overflow
43 PEDANTIC_FLAGS
+= -Wduplicated-branches
-Wduplicated-cond
-Wnull-dereference
44 # -Wstringop-truncation
46 PEDANTIC_CFLAGS
= $(PEDANTIC_FLAGS
)
47 PEDANTIC_CFLAGS
+= -Wc
++-compat
48 PEDANTIC_CFLAGS
+= -Winit-self
-Wjump-misses-init
-Wnested-externs
-Wwrite-strings
49 PEDANTIC_CFLAGS
+= -Wmissing-prototypes
-Wstrict-prototypes
51 PEDANTIC_CXXFLAGS
= $(PEDANTIC_FLAGS
)
52 PEDANTIC_CXXFLAGS
+= -Wc
++0x-compat
-Wc
++11-compat
53 PEDANTIC_CXXFLAGS
+= -Wnon-virtual-dtor
-Woverloaded-virtual
54 PEDANTIC_CXXFLAGS
+= -Wold-style-cast
-Wuseless-cast
55 PEDANTIC_CXXFLAGS
+= -Wzero-as-null-pointer-constant
56 PEDANTIC_CXXFLAGS
+= -Weffc
++
58 PEDANTIC_CXX03_SKIPS
= -Wno-pedantic
59 PEDANTIC_CXX03_SKIPS
+= -Wno-zero-as-null-pointer-constant
61 PEDANTIC_CXX98_SKIPS
= $(PEDANTIC_CXX03_SKIPS
)
62 PEDANTIC_CXX98_SKIPS
+= -Wno-variadic-macros
64 PEDANTIC_LDFLAGS
= -Wl
,-rpath
,$(BINDIR
) -L
$(BINDIR
)
66 # ---------------------------------------------------------------------------------------------------------------------
70 ansi-pedantic-test_c_ansi_run \
71 ansi-pedantic-test_c89_run \
72 ansi-pedantic-test_c99_run \
73 ansi-pedantic-test_c11_run \
74 ansi-pedantic-test_cxx_ansi_run \
75 ansi-pedantic-test_cxx98_run \
76 ansi-pedantic-test_cxx03_run \
77 ansi-pedantic-test_cxx11_run \
78 carla-host-plugin_run \
82 TARGETS
= carla-engine-sdl
$(APP_EXT
)
85 # ---------------------------------------------------------------------------------------------------------------------
89 # ---------------------------------------------------------------------------------------------------------------------
91 ansi-
%_run
: $(BINDIR
)/ansi-
%
94 carla-
%_run
: $(BINDIR
)/carla-
%
95 # valgrind $(BINDIR)/carla-$*
96 valgrind
--leak-check
=full
--show-leak-kinds
=all --suppressions
=valgrind.supp
$(BINDIR
)/carla-
$*
98 # ---------------------------------------------------------------------------------------------------------------------
100 $(BINDIR
)/ansi-pedantic-test_c_ansi
: ansi-pedantic-test.c ..
/backend
/Carla
*.h ..
/includes
/*.h
101 $(CC
) $< $(PEDANTIC_CFLAGS
) $(PEDANTIC_LDFLAGS
) -lcarla_standalone2
-lcarla_utils
-ansi
-o
$@
103 $(BINDIR
)/ansi-pedantic-test_c89
: ansi-pedantic-test.c ..
/backend
/Carla
*.h ..
/includes
/*.h
104 $(CC
) $< $(PEDANTIC_CFLAGS
) $(PEDANTIC_LDFLAGS
) -lcarla_standalone2
-lcarla_utils
-std
=c89
-o
$@
106 $(BINDIR
)/ansi-pedantic-test_c99
: ansi-pedantic-test.c ..
/backend
/Carla
*.h ..
/includes
/*.h
107 $(CC
) $< $(PEDANTIC_CFLAGS
) $(PEDANTIC_LDFLAGS
) -lcarla_standalone2
-lcarla_utils
-std
=c99
-o
$@
109 $(BINDIR
)/ansi-pedantic-test_c11
: ansi-pedantic-test.c ..
/backend
/Carla
*.h ..
/includes
/*.h
110 $(CC
) $< $(PEDANTIC_CFLAGS
) $(PEDANTIC_LDFLAGS
) -lcarla_standalone2
-lcarla_utils
-std
=c11
-o
$@
112 # ---------------------------------------------------------------------------------------------------------------------
114 $(BINDIR
)/ansi-pedantic-test_cxx_ansi
: ansi-pedantic-test.
cpp ..
/backend
/Carla
*.h ..
/backend
/Carla
*.hpp ..
/includes
/*.h
115 $(CXX
) $< $(PEDANTIC_CXXFLAGS
) $(PEDANTIC_CXX98_SKIPS
) $(PEDANTIC_LDFLAGS
) -lcarla_standalone2
-lcarla_utils
-ansi
-Wno-effc
++ -o
$@
117 $(BINDIR
)/ansi-pedantic-test_cxx98
: ansi-pedantic-test.
cpp ..
/backend
/Carla
*.h ..
/backend
/Carla
*.hpp ..
/includes
/*.h
118 $(CXX
) $< $(PEDANTIC_CXXFLAGS
) $(PEDANTIC_CXX98_SKIPS
) $(PEDANTIC_LDFLAGS
) -lcarla_standalone2
-lcarla_utils
-std
=c
++98 -Wno-effc
++ -o
$@
120 $(BINDIR
)/ansi-pedantic-test_cxx03
: ansi-pedantic-test.
cpp ..
/backend
/Carla
*.h ..
/backend
/Carla
*.hpp ..
/includes
/*.h
121 $(CXX
) $< $(PEDANTIC_CXXFLAGS
) $(PEDANTIC_CXX03_SKIPS
) $(PEDANTIC_LDFLAGS
) -lcarla_standalone2
-lcarla_utils
-std
=c
++03 -Wno-effc
++ -o
$@
123 $(BINDIR
)/ansi-pedantic-test_cxx11
: ansi-pedantic-test.
cpp ..
/backend
/Carla
*.h ..
/backend
/Carla
*.hpp ..
/includes
/*.h
124 $(CXX
) $< $(PEDANTIC_CXXFLAGS
) $(PEDANTIC_LDFLAGS
) -lcarla_standalone2
-lcarla_utils
-std
=c
++11 -o
$@
126 # ---------------------------------------------------------------------------------------------------------------------
128 $(BINDIR
)/carla-host-plugin
: carla-host-plugin.c
129 $(CC
) $< $(PEDANTIC_CFLAGS
) $(PEDANTIC_LDFLAGS
) -g
-O0
-Wno-declaration-after-statement
-Wno-pedantic
-lcarla_host-plugin
-std
=c99
-o
$@
131 # ---------------------------------------------------------------------------------------------------------------------
133 .PHONY
: carla-engine-sdl
$(APP_EXT
)
134 carla-engine-sdl
$(APP_EXT
): $(OBJDIR
)/carla-engine-sdl.c.o
$(OBJDIR
)/carla-engine-sdl-extra.
cpp.o
136 $(CWD
)/..
/build
/plugin
/Release
/carla-host-plugin.
cpp.o \
137 $(MODULEDIR
)/carla_engine.a \
138 $(MODULEDIR
)/carla_plugin.a \
139 $(MODULEDIR
)/lilv.a \
140 $(MODULEDIR
)/native-plugins.a \
141 $(MODULEDIR
)/sfzero.a \
142 $(MODULEDIR
)/audio_decoder.a \
143 $(MODULEDIR
)/rtmempool.a \
144 $(MODULEDIR
)/water.a \
145 $(MODULEDIR
)/ysfx.a \
146 $(MODULEDIR
)/zita-resampler.a \
147 $(SDL_LIBS
) --preload-file foolme.mp3
-sALLOW_MEMORY_GROWTH \
150 # ---------------------------------------------------------------------------------------------------------------------
153 rm -f
$(BINDIR
)/ansi-pedantic-test_
* $(BINDIR
)/carla-host-plugin
158 # ---------------------------------------------------------------------------------------------------------------------
163 $(SILENT
)$(CC
) $< $(BUILD_C_FLAGS
) -c
-o
$@
165 $(OBJDIR
)/%.
cpp.o
: %.
cpp
168 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) -c
-o
$@
170 # ---------------------------------------------------------------------------------------------------------------------