Adding meson.build to generate pkg-config.
This commit is contained in:
parent
61629ee4ff
commit
33e61477aa
14
.gitignore
vendored
14
.gitignore
vendored
@ -1,14 +0,0 @@
|
|||||||
# ignore all (get's rid of executables)
|
|
||||||
*
|
|
||||||
|
|
||||||
# unignore with extenstions
|
|
||||||
!*.*
|
|
||||||
|
|
||||||
# unignore directories
|
|
||||||
*/
|
|
||||||
|
|
||||||
# ignore produced files
|
|
||||||
*.o
|
|
||||||
*.so
|
|
||||||
*.elf
|
|
||||||
*.swp
|
|
24
makefile
24
makefile
@ -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
|
|
21
makefile.inc
21
makefile.inc
@ -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
21
meson.build
Normal 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)
|
Loading…
x
Reference in New Issue
Block a user