Skip to content

Commit

Permalink
[build] Add pkgconfig pseudo-target
Browse files Browse the repository at this point in the history
  • Loading branch information
monich committed May 27, 2020
1 parent cd7b3bf commit 94ef2df
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Makefile
Expand Up @@ -7,6 +7,9 @@ all:
test:
@$(MAKE) -C unit $@

pkgconfig:
@$(MAKE) -C core $@

install:
@$(MAKE) -C src $@
@$(MAKE) -C core $@
Expand Down
11 changes: 7 additions & 4 deletions core/Makefile
@@ -1,6 +1,6 @@
# -*- Mode: makefile-gmake -*-

.PHONY: clean all debug release
.PHONY: clean all debug release pkgconfig
.PHONY: print_debug_lib print_release_lib
.PHONY: print_debug_path print_release_path

Expand Down Expand Up @@ -144,6 +144,8 @@ release_lib: $(RELEASE_LIB)

coverage_lib: $(COVERAGE_LIB)

pkgconfig: $(PKGCONFIG)

clean:
rm -f *~ $(SRC_DIR)/*~ $(INCLUDE_DIR)/*~ $(INCLUDE_DIR)/internal/*~
rm -fr $(BUILD_DIR)
Expand Down Expand Up @@ -193,13 +195,14 @@ ABS_LIBDIR := $(shell echo /$(LIBDIR) | sed -r 's|/+|/|g')

INSTALL = install
INSTALL_DIRS = $(INSTALL) -d
INSTALL_FILES = $(INSTALL) -m 644

INSTALL_INCLUDE_DIR = $(DESTDIR)/usr/include/nfcd
INSTALL_PKGCONFIG_DIR = $(DESTDIR)$(ABS_LIBDIR)/pkgconfig

install: $(INSTALL_INCLUDE_DIR) $(INSTALL_PKGCONFIG_DIR) $(PKGCONFIG)
$(INSTALL) -m 644 $(INCLUDE_DIR)/*.h $(INSTALL_INCLUDE_DIR)
$(INSTALL) -m 644 $(PKGCONFIG) $(INSTALL_PKGCONFIG_DIR)
install: $(INSTALL_INCLUDE_DIR) $(INSTALL_PKGCONFIG_DIR)
$(INSTALL_FILES) $(INCLUDE_DIR)/*.h $(INSTALL_INCLUDE_DIR)
$(INSTALL_FILES) $(PKGCONFIG) $(INSTALL_PKGCONFIG_DIR)

$(INSTALL_INCLUDE_DIR):
$(INSTALL_DIRS) $@
Expand Down
2 changes: 1 addition & 1 deletion rpm/nfcd.spec
Expand Up @@ -47,7 +47,7 @@ This package contains command line NFC tools.
%setup -q

%build
make KEEP_SYMBOLS=1 release
make LIBDIR=%{_libdir} KEEP_SYMBOLS=1 release pkgconfig

%install
%define target_wants_dir %{_unitdir}/network.target.wants
Expand Down

0 comments on commit 94ef2df

Please sign in to comment.