summaryrefslogtreecommitdiff
path: root/apps/codecs/libffmpegFLAC/libffmpegFLAC.make
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libffmpegFLAC/libffmpegFLAC.make')
-rw-r--r--apps/codecs/libffmpegFLAC/libffmpegFLAC.make12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/codecs/libffmpegFLAC/libffmpegFLAC.make b/apps/codecs/libffmpegFLAC/libffmpegFLAC.make
index 734f3d2..aae18ae 100644
--- a/apps/codecs/libffmpegFLAC/libffmpegFLAC.make
+++ b/apps/codecs/libffmpegFLAC/libffmpegFLAC.make
@@ -13,6 +13,18 @@ FFMPEGFLACLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libffmpegFLAC/SOURCES)
FFMPEGFLACLIB_OBJ := $(call c2obj, $(FFMPEGFLACLIB_SRC))
OTHER_SRC += $(FFMPEGFLACLIB_SRC)
+# libffmpegFLAC is faster on ARM-targets with -O2 than -O1
+FFMPEGFLACFLAGS = -I$(APPSDIR)/codecs/libffmpegFLAC $(filter-out -O%,$(CODECFLAGS))
+ifeq ($(CPU),arm)
+ FFMPEGFLACFLAGS += -O2
+else
+ FFMPEGFLACFLAGS += -O1
+endif
+
$(FFMPEGFLACLIB): $(FFMPEGFLACLIB_OBJ)
$(SILENT)$(shell rm -f $@)
$(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
+
+$(CODECDIR)/libffmpegFLAC/%.o: $(ROOTDIR)/apps/codecs/libffmpegFLAC/%.c
+ $(SILENT)mkdir -p $(dir $@)
+ $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(FFMPEGFLACFLAGS) -c $< -o $@
146' href='#n146'>146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243
# -*- sh -*-
# Build script to build Puzzles.
#
# You can cut out large components of the build by defining a subset
# of these options on the bob command line:
# -DNOTEST -DNOSIGN -DNOWINDOWS -DNOMACOS -DNOICONS -DNOJAVA -DNOJS

module puzzles

set Version $(!builddate).$(vcsid)

# Put the version number into the documentation as a versionid.
# use perl to avoid inconsistent behaviour of echo '\v'
in puzzles do perl -e 'print "\n\\versionid Simon Tatham'\''s Portable Puzzle Collection, version $$ARGV[0]\n"' $(Version) >> puzzles.but
in puzzles do perl -e 'print "\n\\versionid Simon Tatham'\''s Portable Puzzle Collection, version $$ARGV[0]\n"' $(Version) >> devel.but

# Write out a version.h that contains the real version number.
in puzzles do echo '/* Generated by automated build script */' > version.h
in puzzles do echo '$#define VER "Version $(Version)"' >> version.h
in puzzles do perl -e '$$ARGV[0] =~ m{(....)(..)(..)} or die; print "$#define VERSIONINFO_BINARY_VERSION 1,$$1,$$2,$$3\n"' $(!builddate) >> version.h

# And do the same substitution in the OS X metadata. (This is a bit
# icky in principle because it presumes that my version numbers don't
# need XML escaping, but frankly, if they ever do then I should fix
# them!)
in puzzles do perl -i -pe 's/Unidentified build/$(Version)/' osx/Info.plist

# And in the KaiOS metadata generator.
in puzzles do perl -i -pe 's/Unidentified build/$(Version)/' kaios/manifest.pl

ifneq "$(NOICONS)" yes then
  # Run enough of a native Unix build to produce the various icons.
  # This also checks that the build completes in 'strict' mode (with
  # lots of warnings and -Werror), and triggers a build failure if
  # not.
  in . do cmake -B build-icons puzzles -DSTRICT=ON
  in build-icons do make -j$(nproc)
  in build-icons do make -j$(nproc) icons VERBOSE=1

  # Copy the C icon files into the icons source subdirectory, for the
  # distribution tarball.
  in . do cp build-icons/icons/*-icon.c puzzles/icons
endif

ifneq "$(NOTEST)" yes then
  # Run tests. In particular, ensure we build in 'strict' mode with
  # both gcc and clang.
  ifeq "$(NOICONS)" yes then
    # We don't need to run the gcc build if we did it above for the icons
    in . do cmake -B test-gcc puzzles -DSTRICT=ON
    in test-gcc do make -j$(nproc)
  endif

  in . do cmake -B test-clang puzzles -DSTRICT=ON -DCMAKE_C_COMPILER=clang
  in test-clang do make -j$(nproc)
endif

# The very first thing we do is to make the source archive, before we
# fill up the build directory with extra files.
delegate -
  # Build Windows Help and text versions of the manual for convenience.
  in puzzles do halibut --winhelp=puzzles.hlp --text=puzzles.txt puzzles.but
  # Build a text version of the HACKING document.
  in puzzles do halibut --text=HACKING devel.but
  # Get rid of some cruft that isn't really useful in a source tarball.
  in puzzles do rm -f Buildscr CHECKLST.txt .gitignore webpage.pl
  in . do ln -s puzzles puzzles-$(Version)
  in . do tar -chzf puzzles-$(Version).tar.gz puzzles-$(Version)
  return puzzles-$(Version).tar.gz
enddelegate

ifneq "$(NOMACOS)" yes then
  # Build the OS X binaries and .dmg archive.
  delegate osx