From 33e61477aa01eb5e9c2d261ae5fc200c122f4f71 Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Sun, 17 Jul 2022 20:29:09 +0200 Subject: [PATCH] Adding meson.build to generate pkg-config. --- .gitignore | 14 -------------- makefile | 24 ------------------------ makefile.inc | 21 --------------------- meson.build | 21 +++++++++++++++++++++ 4 files changed, 21 insertions(+), 59 deletions(-) delete mode 100644 makefile delete mode 100644 makefile.inc create mode 100644 meson.build diff --git a/.gitignore b/.gitignore index 0b4387a..e69de29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +0,0 @@ -# ignore all (get's rid of executables) -* - -# unignore with extenstions -!*.* - -# unignore directories -*/ - -# ignore produced files -*.o -*.so -*.elf -*.swp diff --git a/makefile b/makefile deleted file mode 100644 index b23f48d..0000000 --- a/makefile +++ /dev/null @@ -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 diff --git a/makefile.inc b/makefile.inc deleted file mode 100644 index b3e22db..0000000 --- a/makefile.inc +++ /dev/null @@ -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 diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..cbe90bd --- /dev/null +++ b/meson.build @@ -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)