blob: d660e0d65324ca7a174f43e345335489fed7d874 [file] [log] [blame]
Taylor Hutt89822042011-08-23 14:44:34 -07001# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4ifndef BOARD
Taylor Hutt8e648ba2012-06-22 09:40:58 -07005$(error 'BOARD' is not defined. Unable to build ADHD.)
Taylor Hutt89822042011-08-23 14:44:34 -07006endif
7
8export ADHD_DIR = $(shell pwd)
9include $(ADHD_DIR)/defs/definitions.mk
10
Taylor Hutt8e648ba2012-06-22 09:40:58 -070011all: cras
Taylor Huttbbca6ef2012-02-23 09:33:34 -080012
13cras:
14 @$(call remake,Building,$@,cras.mk,$@)
15
16cras_install:
17 @$(call remake,Building,cras,cras.mk,$@)
Taylor Hutt89822042011-08-23 14:44:34 -070018
Taylor Hutt74c470f2012-03-16 12:26:37 -070019$(DESTDIR)/lib/udev/rules.d/99-dev-input-group.rules: \
20 $(ADHD_DIR)/udev/99-dev-input-group.rules
21 $(ECHO) "Installing '$<' to '$@'"
Dylan Reidcb4121a2012-05-07 01:12:16 -070022 $(INSTALL) --mode 644 -D $< $@
Taylor Hutt74c470f2012-03-16 12:26:37 -070023
Dylan Reidb3cea3e2012-02-21 23:21:25 -080024$(DESTDIR)/etc/init/cras.conf: $(ADHD_DIR)/upstart/cras.conf
25 $(ECHO) "Installing '$<' to '$@'"
Dylan Reidcb4121a2012-05-07 01:12:16 -070026 $(INSTALL) --mode 644 -D $< $@
Dylan Reidb3cea3e2012-02-21 23:21:25 -080027
Taylor Hutt0774f332011-12-01 13:37:03 -080028$(DESTDIR)/etc/asound.state: $(ADHD_DIR)/factory-default/asound.state.$(BOARD)
Taylor Huttbbca6ef2012-02-23 09:33:34 -080029 $(ECHO) "Installing '$<' to '$@'"
Dylan Reidcb4121a2012-05-07 01:12:16 -070030 $(INSTALL) --mode 644 -D $< $@
Taylor Hutt0774f332011-12-01 13:37:03 -080031
Dylan Reid3683d5e2012-06-06 20:42:05 -070032optional_alsa_conf := $(wildcard $(ADHD_DIR)/alsa-module-config/alsa-$(BOARD).conf)
33
34ifneq ($(strip $(optional_alsa_conf)),)
35
36$(DESTDIR)/etc/modprobe.d/alsa-$(BOARD).conf: $(optional_alsa_conf)
37 $(ECHO) "Installing '$<' to '$@'"
38 $(INSTALL) --mode 644 -D $< $@
39
40install: $(DESTDIR)/etc/modprobe.d/alsa-$(BOARD).conf
41
42endif
43
Dylan Reidbeae5e42012-06-18 17:37:11 -070044optional_cras_conf := $(wildcard $(ADHD_DIR)/cras-config/$(BOARD)/*)
45
46ifneq ($(strip $(optional_cras_conf)),)
47
48.PHONY: cras-config-files
49cras-config-files:
50 $(ECHO) "Installing cras config files"
51 $(INSTALL) --mode 755 -d $(DESTDIR)etc/cras/
52 $(INSTALL) --mode 644 -D "$(optional_cras_conf)" $(DESTDIR)etc/cras/
53
54install: cras-config-files
55
56endif
57
Taylor Hutt023f5f82012-06-21 07:44:15 -070058install: $(DESTDIR)/etc/init/cras.conf \
Taylor Hutt74c470f2012-03-16 12:26:37 -070059 $(DESTDIR)/etc/asound.state \
Taylor Hutt74c470f2012-03-16 12:26:37 -070060 $(DESTDIR)/lib/udev/rules.d/99-dev-input-group.rules \
Taylor Huttbbca6ef2012-02-23 09:33:34 -080061 cras_install
Taylor Hutt89822042011-08-23 14:44:34 -070062clean:
63 @rm -rf $(ADHD_BUILD_DIR)
64
Taylor Hutt8e648ba2012-06-22 09:40:58 -070065.PHONY: clean cras cras_install