2015-07-28 12:25:25 +07:00
|
|
|
# tools/power/acpi/Makefile.rules - ACPI tool Makefile
|
|
|
|
#
|
|
|
|
# Copyright (c) 2015, Intel Corporation
|
|
|
|
# Author: Lv Zheng <lv.zheng@intel.com>
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; version 2
|
|
|
|
# of the License.
|
|
|
|
|
2016-11-16 16:27:34 +07:00
|
|
|
objdir := $(OUTPUT)tools/$(TOOL)/
|
|
|
|
toolobjs := $(addprefix $(objdir),$(TOOL_OBJS))
|
|
|
|
$(OUTPUT)$(TOOL): $(toolobjs) FORCE
|
|
|
|
$(ECHO) " LD " $(subst $(OUTPUT),,$@)
|
|
|
|
$(QUIET) $(LD) $(CFLAGS) $(LDFLAGS) $(toolobjs) -L$(OUTPUT) -o $@
|
|
|
|
$(ECHO) " STRIP " $(subst $(OUTPUT),,$@)
|
2015-07-28 12:25:25 +07:00
|
|
|
$(QUIET) $(STRIPCMD) $@
|
|
|
|
|
2016-11-16 16:27:34 +07:00
|
|
|
$(KERNEL_INCLUDE):
|
|
|
|
$(ECHO) " MKDIR " $(subst $(OUTPUT),,$@)
|
|
|
|
$(QUIET) mkdir -p $(KERNEL_INCLUDE)
|
|
|
|
$(ECHO) " CP " $(subst $(OUTPUT),,$@)
|
|
|
|
$(QUIET) cp -rf $(srctree)/../../../include/acpi $(KERNEL_INCLUDE)/
|
|
|
|
|
|
|
|
$(objdir)%.o: %.c $(KERNEL_INCLUDE)
|
|
|
|
$(ECHO) " CC " $(subst $(OUTPUT),,$@)
|
2015-07-28 12:25:25 +07:00
|
|
|
$(QUIET) $(CC) -c $(CFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
all: $(OUTPUT)$(TOOL)
|
|
|
|
clean:
|
2016-11-16 16:27:34 +07:00
|
|
|
$(ECHO) " RMOBJ " $(subst $(OUTPUT),,$(objdir))
|
|
|
|
$(QUIET) find $(objdir) \( -not -type d \)\
|
|
|
|
-and \( -name '*~' -o -name '*.[oas]' \)\
|
|
|
|
-type f -print | xargs rm -f
|
|
|
|
$(ECHO) " RM " $(TOOL)
|
|
|
|
$(QUIET) rm -f $(OUTPUT)$(TOOL)
|
|
|
|
$(ECHO) " RMINC " $(subst $(OUTPUT),,$(KERNEL_INCLUDE))
|
|
|
|
$(QUIET) rm -rf $(KERNEL_INCLUDE)
|
2015-07-28 12:25:25 +07:00
|
|
|
|
|
|
|
install-tools:
|
2016-11-16 16:27:34 +07:00
|
|
|
$(ECHO) " INST " $(TOOL)
|
|
|
|
$(QUIET) $(INSTALL) -d $(DESTDIR)$(sbindir)
|
|
|
|
$(QUIET) $(INSTALL_PROGRAM) $(OUTPUT)$(TOOL) $(DESTDIR)$(sbindir)
|
2015-07-28 12:25:25 +07:00
|
|
|
uninstall-tools:
|
2016-11-16 16:27:34 +07:00
|
|
|
$(ECHO) " UNINST " $(TOOL)
|
|
|
|
$(QUIET) rm -f $(DESTDIR)$(sbindir)/$(TOOL)
|
2015-07-28 12:25:25 +07:00
|
|
|
|
|
|
|
install: all install-tools $(EXTRA_INSTALL)
|
|
|
|
uninstall: uninstall-tools $(EXTRA_UNINSTALL)
|
|
|
|
|
|
|
|
.PHONY: FORCE
|