blob: c6106e7489af791fd35f94f670c7695845d53b9d [file] [log] [blame]
#
# Copyright (c) 2015 Nest Labs, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
LOCAL_PATH := $(call my-dir)
# This makefile uses 2 code generators:
#
# 1. gengetopt - this needs to be installed on the host.
# 2. audio-tool-build-generate-wave-table - this is built as part of
# the project.
#
# This makefile is a little confusing because it must handle this.
# For the wave tables, all the source files are properly generated in
# the intermediates directory. However, for gengetopt, the cleanest
# solution is to generate the files in the source directory instead of
# the intermediates directory, because it avoids having to
# -I. (i.e. the android top-of-tree).
LIBAUDIO_TOOL_INTERMEDIATES := $(TARGET_OUT_INTERMEDIATES)/STATIC_LIBRARIES/libaudio-tool_intermediates
AUDIO_TOOL_INTERMEDIATES := $(TARGET_OUT_INTERMEDIATES)/EXECUTABLES/audio-tool_intermediates
include $(CLEAR_VARS)
LOCAL_MODULE := audio-tool-build-generate-wave-table
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_SRC_FILES := generate-wave-table.c
include $(BUILD_HOST_EXECUTABLE)
$(LIBAUDIO_TOOL_INTERMEDIATES):
mkdir -p $(LIBAUDIO_TOOL_INTERMEDIATES)
$(LIBAUDIO_TOOL_INTERMEDIATES)/table_%.c: $(HOST_OUT_EXECUTABLES)/audio-tool-build-generate-wave-table | $(LIBAUDIO_TOOL_INTERMEDIATES)
audio-tool-build-generate-wave-table $(basename $*) 2048 S16 > $@
include $(CLEAR_VARS)
LOCAL_MODULE := libaudio-tool
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include \
$(LOCAL_PATH) \
$(LIBAUDIO_TOOL_INTERMEDIATES)
LOCAL_CFLAGS += -Wno-unused-parameter
LOCAL_ADDITIONAL_DEPENDENCIES := \
$(LIBAUDIO_TOOL_INTERMEDIATES)/table_square.c \
$(LIBAUDIO_TOOL_INTERMEDIATES)/table_sine.c \
$(LIBAUDIO_TOOL_INTERMEDIATES)/table_triangle.c \
$(LIBAUDIO_TOOL_INTERMEDIATES)/table_sawtooth.c
LOCAL_SRC_FILES := \
tinyplay.c \
tinycap.c \
tinymix.c \
mixer.c \
pcm.c \
pulse-generator.c \
tone-generator.c \
oscillator-table.c \
save.c \
restore.c \
mixer_cache.c \
module.c \
defaults.c \
alsa-control.c \
config_cmd.c\
wav_chan_splitter.c \
rms.c
include $(BUILD_STATIC_LIBRARY)
# also generates cmdline.h
AUDIO_TOOL_SRC_PATH := $(value LOCAL_PATH)
$(AUDIO_TOOL_SRC_PATH)/cmdline.c: GENGETOPT_OUTPUT_DIR := $(AUDIO_TOOL_SRC_PATH)
$(AUDIO_TOOL_SRC_PATH)/cmdline.c: ABS_PATH_TO_GGO := $(abspath $(LOCAL_PATH)/cmdline.ggo)
$(AUDIO_TOOL_SRC_PATH)/cmdline.c: $(LOCAL_PATH)/cmdline.ggo
cd $(GENGETOPT_OUTPUT_DIR) && gengetopt --input=$(ABS_PATH_TO_GGO) --file-name=cmdline --unamed-opts
include $(CLEAR_VARS)
LOCAL_MODULE := audio-tool
LOCAL_MODULE_TAGS := debug
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include \
$(LOCAL_PATH) \
$(AUDIO_TOOL_INTERMEDIATES)
LOCAL_CFLAGS := \
-DVERSION_STR="\"1.1-rc1\"" \
-DCMDLINE_PARSER_VERSION="\"1.1-rc1\"" \
-DVERSION=0x0100F0
LOCAL_ADDITIONAL_DEPENDENCIES := $(AUDIO_TOOL_SRC_PATH)/cmdline.c
LOCAL_SRC_FILES := \
main.c \
config.c \
cmdline.c
LOCAL_STATIC_LIBRARIES := libaudio-tool
include $(BUILD_EXECUTABLE)
include $(CLEAR_VARS)
LOCAL_MODULE := audio-config
LOCAL_MODULE_TAGS := debug
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := audio-config
include $(BUILD_PREBUILT)