Adding meson.build to generate pkg-config.

This commit is contained in:
sergiotarxz 2022-07-17 20:29:09 +02:00
parent 61629ee4ff
commit 33e61477aa
4 changed files with 21 additions and 59 deletions

14
.gitignore vendored
View File

@ -1,14 +0,0 @@
# ignore all (get's rid of executables)
*
# unignore with extenstions
!*.*
# unignore directories
*/
# ignore produced files
*.o
*.so
*.elf
*.swp

View File

@ -1,24 +0,0 @@
.SECONDEXPANSION:
LIBRARIES := elfspy
elfspy_OBJS := \
Error.o \
Report.o \
Fail.o \
MFile.o \
SectionHeader.o \
ELFInfo.o \
GOTEntry.o \
SPY.o \
Call.o
INC_DIR := ..
LIB_DIR := .
include makefile.inc
all : $(BINARIES) $(LIB_TARGETS)
cd examples; make
.DEFAULT_GOAL := all

View File

@ -1,21 +0,0 @@
CXXFLAGS := $(patsubst %,-I%,$(INC_DIR)) -std=c++14 -g -fPIC -O0
BIND_ALL := -z now
LD_FLAGS := # $(BIND_ALL)
%.o : %.cpp
g++ $(CXXFLAGS) -c $< -o $@
LIB_TARGETS=$(patsubst %,lib%.so,$(LIBRARIES))
$(LIB_TARGETS) : $$($$(patsubst lib%.so,%,$$@)_OBJS)
g++ $(CXXFLAGS) -shared $^ -o $@ $(LD_FLAGS)
readelf -Wa $@ | c++filt > $(@:%.so=%.elf)
$(BINARIES) : $$(@).cpp $$(patsubst %,lib%.so,$$($$@_LIBRARIES))
g++ $(CXXFLAGS) $(@).cpp -o $@ $(LD_FLAGS) $(patsubst %,-L%,$(LIB_DIR)) $(patsubst %,-l%,$($@_LIBRARIES) $($@_LIBS)) -rdynamic -ldl
readelf -Wa $@ | c++filt > $(@).elf
clean :
rm -f *.o *.so $(BINARIES) *.elf

21
meson.build Normal file
View File

@ -0,0 +1,21 @@
project('me.sergiotarxz.elfspy', 'cpp')
pkg = import('pkgconfig')
sources = [
'Call.cpp',
'Report.cpp',
'ELFInfo.cpp',
'SPY.cpp',
'Error.cpp',
'SectionHeader.cpp',
'GOTEntry.cpp',
'Fail.cpp',
'MFile.cpp',
]
elfspylib = library('elfspy',
sources,
install : true,
include_directories: ['..', '.'],
)
pkg.generate(elfspylib)