1 # tools/power/acpi/Makefile.rules - ACPI tool Makefile
3 # Copyright (c) 2015, Intel Corporation
4 # Author: Lv Zheng <lv.zheng@intel.com>
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
11 objdir := $(OUTPUT)tools/$(TOOL)/
12 toolobjs := $(addprefix $(objdir),$(TOOL_OBJS))
13 $(OUTPUT)$(TOOL): $(toolobjs) FORCE
14 $(ECHO) " LD " $(subst $(OUTPUT),,$@)
15 $(QUIET) $(LD) $(CFLAGS) $(LDFLAGS) $(toolobjs) -L$(OUTPUT) -o $@
16 $(ECHO) " STRIP " $(subst $(OUTPUT),,$@)
17 $(QUIET) $(STRIPCMD) $@
20 $(ECHO) " MKDIR " $(subst $(OUTPUT),,$@)
21 $(QUIET) mkdir -p $(KERNEL_INCLUDE)
22 $(ECHO) " CP " $(subst $(OUTPUT),,$@)
23 $(QUIET) cp -rf $(srctree)/../../../include/acpi $(KERNEL_INCLUDE)/
25 $(objdir)%.o: %.c $(KERNEL_INCLUDE)
26 $(ECHO) " CC " $(subst $(OUTPUT),,$@)
27 $(QUIET) $(CC) -c $(CFLAGS) -o $@ $<
31 $(ECHO) " RMOBJ " $(subst $(OUTPUT),,$(objdir))
32 $(QUIET) find $(objdir) \( -not -type d \)\
33 -and \( -name '*~' -o -name '*.[oas]' \)\
34 -type f -print | xargs rm -f
35 $(ECHO) " RM " $(TOOL)
36 $(QUIET) rm -f $(OUTPUT)$(TOOL)
37 $(ECHO) " RMINC " $(subst $(OUTPUT),,$(KERNEL_INCLUDE))
38 $(QUIET) rm -rf $(KERNEL_INCLUDE)
41 $(ECHO) " INST " $(TOOL)
42 $(QUIET) $(INSTALL) -d $(DESTDIR)$(sbindir)
43 $(QUIET) $(INSTALL_PROGRAM) $(OUTPUT)$(TOOL) $(DESTDIR)$(sbindir)
45 $(ECHO) " UNINST " $(TOOL)
46 $(QUIET) rm -f $(DESTDIR)$(sbindir)/$(TOOL)
48 install: all install-tools $(EXTRA_INSTALL)
49 uninstall: uninstall-tools $(EXTRA_UNINSTALL)