Taylor Hutt | 8982204 | 2011-08-23 14:44:34 -0700 | [diff] [blame] | 1 | # 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. |
| 4 | ifndef BOARD |
Taylor Hutt | 8e648ba | 2012-06-22 09:40:58 -0700 | [diff] [blame^] | 5 | $(error 'BOARD' is not defined. Unable to build ADHD.) |
Taylor Hutt | 8982204 | 2011-08-23 14:44:34 -0700 | [diff] [blame] | 6 | endif |
| 7 | |
| 8 | export ADHD_DIR = $(shell pwd) |
| 9 | include $(ADHD_DIR)/defs/definitions.mk |
| 10 | |
Taylor Hutt | 8e648ba | 2012-06-22 09:40:58 -0700 | [diff] [blame^] | 11 | all: cras |
Taylor Hutt | bbca6ef | 2012-02-23 09:33:34 -0800 | [diff] [blame] | 12 | |
| 13 | cras: |
| 14 | @$(call remake,Building,$@,cras.mk,$@) |
| 15 | |
| 16 | cras_install: |
| 17 | @$(call remake,Building,cras,cras.mk,$@) |
Taylor Hutt | 8982204 | 2011-08-23 14:44:34 -0700 | [diff] [blame] | 18 | |
Taylor Hutt | 74c470f | 2012-03-16 12:26:37 -0700 | [diff] [blame] | 19 | $(DESTDIR)/lib/udev/rules.d/99-dev-input-group.rules: \ |
| 20 | $(ADHD_DIR)/udev/99-dev-input-group.rules |
| 21 | $(ECHO) "Installing '$<' to '$@'" |
Dylan Reid | cb4121a | 2012-05-07 01:12:16 -0700 | [diff] [blame] | 22 | $(INSTALL) --mode 644 -D $< $@ |
Taylor Hutt | 74c470f | 2012-03-16 12:26:37 -0700 | [diff] [blame] | 23 | |
Dylan Reid | b3cea3e | 2012-02-21 23:21:25 -0800 | [diff] [blame] | 24 | $(DESTDIR)/etc/init/cras.conf: $(ADHD_DIR)/upstart/cras.conf |
| 25 | $(ECHO) "Installing '$<' to '$@'" |
Dylan Reid | cb4121a | 2012-05-07 01:12:16 -0700 | [diff] [blame] | 26 | $(INSTALL) --mode 644 -D $< $@ |
Dylan Reid | b3cea3e | 2012-02-21 23:21:25 -0800 | [diff] [blame] | 27 | |
Taylor Hutt | 0774f33 | 2011-12-01 13:37:03 -0800 | [diff] [blame] | 28 | $(DESTDIR)/etc/asound.state: $(ADHD_DIR)/factory-default/asound.state.$(BOARD) |
Taylor Hutt | bbca6ef | 2012-02-23 09:33:34 -0800 | [diff] [blame] | 29 | $(ECHO) "Installing '$<' to '$@'" |
Dylan Reid | cb4121a | 2012-05-07 01:12:16 -0700 | [diff] [blame] | 30 | $(INSTALL) --mode 644 -D $< $@ |
Taylor Hutt | 0774f33 | 2011-12-01 13:37:03 -0800 | [diff] [blame] | 31 | |
Dylan Reid | 3683d5e | 2012-06-06 20:42:05 -0700 | [diff] [blame] | 32 | optional_alsa_conf := $(wildcard $(ADHD_DIR)/alsa-module-config/alsa-$(BOARD).conf) |
| 33 | |
| 34 | ifneq ($(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 | |
| 40 | install: $(DESTDIR)/etc/modprobe.d/alsa-$(BOARD).conf |
| 41 | |
| 42 | endif |
| 43 | |
Dylan Reid | beae5e4 | 2012-06-18 17:37:11 -0700 | [diff] [blame] | 44 | optional_cras_conf := $(wildcard $(ADHD_DIR)/cras-config/$(BOARD)/*) |
| 45 | |
| 46 | ifneq ($(strip $(optional_cras_conf)),) |
| 47 | |
| 48 | .PHONY: cras-config-files |
| 49 | cras-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 | |
| 54 | install: cras-config-files |
| 55 | |
| 56 | endif |
| 57 | |
Taylor Hutt | 023f5f8 | 2012-06-21 07:44:15 -0700 | [diff] [blame] | 58 | install: $(DESTDIR)/etc/init/cras.conf \ |
Taylor Hutt | 74c470f | 2012-03-16 12:26:37 -0700 | [diff] [blame] | 59 | $(DESTDIR)/etc/asound.state \ |
Taylor Hutt | 74c470f | 2012-03-16 12:26:37 -0700 | [diff] [blame] | 60 | $(DESTDIR)/lib/udev/rules.d/99-dev-input-group.rules \ |
Taylor Hutt | bbca6ef | 2012-02-23 09:33:34 -0800 | [diff] [blame] | 61 | cras_install |
Taylor Hutt | 8982204 | 2011-08-23 14:44:34 -0700 | [diff] [blame] | 62 | clean: |
| 63 | @rm -rf $(ADHD_BUILD_DIR) |
| 64 | |
Taylor Hutt | 8e648ba | 2012-06-22 09:40:58 -0700 | [diff] [blame^] | 65 | .PHONY: clean cras cras_install |