Skip to content

Commit

Permalink
libpfm: make building less verbose and hide artifacts from git
Browse files Browse the repository at this point in the history
Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
  • Loading branch information
wipawel authored and dkgupta-amzn committed Oct 8, 2021
1 parent f427ac9 commit 4a89685
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@ cscope.*
Makeconf.local
.DS_Store
drivers/acpi/acpica/source/
third-party/libpfm/COPYING
third-party/libpfm/Makefile
third-party/libpfm/README
third-party/libpfm/config.mk
third-party/libpfm/include/
third-party/libpfm/lib/
third-party/libpfm/libpfm.a
third-party/libpfm/rules.mk
17 changes: 8 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ PFMLIB_TARBALL := $(PFMLIB_DIR)/$(PFMLIB_NAME)-$(PFMLIB_VER).tar.gz
ifeq ($(CONFIG_LIBPFM),y)
KTF_PFMLIB_COMPILE := 1
export KTF_PFMLIB_COMPILE
TAR_CMD_PFMLIB := tar --exclude=.git --exclude=.gitignore --strip-components=1 -xvf
TAR_CMD_PFMLIB := tar --exclude=.git --exclude=.gitignore --strip-components=1 -xf
PFMLIB_TOOLS_DIR := $(KTF_ROOT)/$(TOOLS_DIR)/$(PFMLIB_NAME)
PFMLIB_ARCHIVE := $(PFMLIB_DIR)/$(PFMLIB_NAME).a
PFMLIB_UNTAR_FILES := $(PFMLIB_NAME)-$(PFMLIB_VER)/lib
Expand Down Expand Up @@ -171,16 +171,15 @@ $(TARGET): $(PFMLIB_ARCHIVE) $(OBJS) $(PREP_LINK_SCRIPT)
$(VERBOSE) $(LD) -T $(PREP_LINK_SCRIPT) -o $@ $(OBJS) $(PFMLIB_LINKER_FLAGS) $(SYMBOLS_NAME).o

$(PFMLIB_ARCHIVE): $(PFMLIB_TARBALL)
@echo "UNTAR pfmlib"
# untar tarball and apply the patch
cd $(PFMLIB_DIR) &&\
@echo "UNTAR libpfm"
$(VERBOSE) cd $(PFMLIB_DIR) &&\
$(TAR_CMD_PFMLIB) $(PFMLIB_TARBALL) $(PFMLIB_UNTAR_FILES) -C ./ &&\
$(PATCH) -p1 < $(PFMLIB_PATCH_FILE) &&\
$(PATCH) -s -p1 < $(PFMLIB_PATCH_FILE) &&\
cd -
# invoke libpfm build
$(MAKE) -C $(PFMLIB_DIR) lib &&\
cp $(PFMLIB_DIR)/lib/$(PFMLIB_NAME).a $(PFMLIB_DIR)/
find $(PFMLIB_DIR) -name \*.c -delete
@echo "BUILD libpfm"
$(VERBOSE) $(MAKE) -C $(PFMLIB_DIR) lib
$(VERBOSE) cp $(PFMLIB_DIR)/lib/$(PFMLIB_NAME).a $(PFMLIB_DIR)/
$(VERBOSE) find $(PFMLIB_DIR) -name \*.c -delete

%.o: %.S
@echo "AS " $@
Expand Down

0 comments on commit 4a89685

Please sign in to comment.