2019-06-01 11:08:55 +03:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2015-07-28 08:25:25 +03:00
|
|
|
# tools/power/acpi/Makefile.rules - ACPI tool Makefile
|
|
|
|
#
|
|
|
|
# Copyright (c) 2015, Intel Corporation
|
|
|
|
# Author: Lv Zheng <lv.zheng@intel.com>
|
|
|
|
#
|
|
|
|
|
2016-11-16 12:27:34 +03: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 08:25:25 +03:00
|
|
|
$(QUIET) $(STRIPCMD) $@
|
|
|
|
|
2016-11-16 12:27:34 +03: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 08:25:25 +03:00
|
|
|
$(QUIET) $(CC) -c $(CFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
all: $(OUTPUT)$(TOOL)
|
|
|
|
clean:
|
2016-11-16 12:27:34 +03: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 08:25:25 +03:00
|
|
|
|
|
|
|
install-tools:
|
2016-11-16 12:27:34 +03:00
|
|
|
$(ECHO) " INST " $(TOOL)
|
|
|
|
$(QUIET) $(INSTALL) -d $(DESTDIR)$(sbindir)
|
|
|
|
$(QUIET) $(INSTALL_PROGRAM) $(OUTPUT)$(TOOL) $(DESTDIR)$(sbindir)
|
2015-07-28 08:25:25 +03:00
|
|
|
uninstall-tools:
|
2016-11-16 12:27:34 +03:00
|
|
|
$(ECHO) " UNINST " $(TOOL)
|
|
|
|
$(QUIET) rm -f $(DESTDIR)$(sbindir)/$(TOOL)
|
2015-07-28 08:25:25 +03:00
|
|
|
|
|
|
|
install: all install-tools $(EXTRA_INSTALL)
|
|
|
|
uninstall: uninstall-tools $(EXTRA_UNINSTALL)
|
|
|
|
|
|
|
|
.PHONY: FORCE
|