Skip to content

Commit

Permalink
Generate pkg-config files for both libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
Austin Clements committed Sep 29, 2013
1 parent b59e022 commit 2265765
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
all: elf/libelf++.a dwarf/libdwarf++.a

elf/libelf++.a: always
$(MAKE) -C elf libelf++.a

dwarf/libdwarf++.a: always
$(MAKE) -C dwarf libdwarf++.a

.PHONY: always
all:
$(MAKE) -C elf
$(MAKE) -C dwarf

clean:
$(MAKE) -C elf clean
Expand Down
15 changes: 15 additions & 0 deletions dwarf/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
CXXFLAGS+=-g -O2 -Werror
override CXXFLAGS+=-std=c++0x -Wall

all: libdwarf++.a libdwarf++.pc

SRCS := dwarf.cc cursor.cc die.cc value.cc abbrev.cc \
expr.cc rangelist.cc line.cc attrs.cc \
die_str_map.cc elf.cc to_string.cc
Expand All @@ -26,6 +28,19 @@ to_string.cc: ../elf/enum-print.py dwarf++.hh data.hh Makefile
@echo 'DWARFPP_END_NAMESPACE' >> to_string.cc
CLEAN += to_string.cc

libdwarf++.pc: always
@(VER=$$(git describe --match 'v*' | sed -e s/^v//); \
echo "prefix=$$PWD"; \
echo "Name: libdwarf++"; \
echo "Description: C++11 DWARF library"; \
echo "Version: $$VER"; \
echo "Requires: libelf++ = $$VER"; \
echo "Libs: -L\$${prefix} -ldwarf++"; \
echo "Cflags: -I\$${prefix}") > $@
CLEAN += libdwarf++.pc

.PHONY: always

clean:
rm -f $(CLEAN)

Expand Down
14 changes: 14 additions & 0 deletions elf/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
CXXFLAGS+=-g -O2 -Werror
override CXXFLAGS+=-std=c++0x -Wall

all: libelf++.a libelf++.pc

SRCS := elf.cc mmap_loader.cc to_string.cc
HDRS := elf++.hh data.hh common.hh to_hex.hh
CLEAN :=
Expand All @@ -25,6 +27,18 @@ to_string.cc: enum-print.py data.hh Makefile
@echo 'ELFPP_END_NAMESPACE' >> to_string.cc
CLEAN += to_string.cc

libelf++.pc: always
@(VER=$$(git describe --match 'v*' | sed -e s/^v//); \
echo "prefix=$$PWD"; \
echo "Name: libelf++"; \
echo "Description: C++11 ELF library"; \
echo "Version: $$VER"; \
echo "Libs: -L\$${prefix} -lelf++"; \
echo "Cflags: -I\$${prefix}") > $@
CLEAN += libelf++.pc

.PHONY: always

clean:
rm -f $(CLEAN)

Expand Down

0 comments on commit 2265765

Please sign in to comment.