Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pt-run command implementation using Lua C API #12

Merged
merged 3 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ jobs:
- name: Build
run: |
sudo make install
luarocks --local make

- name: Install Busted
run: luarocks --local install busted
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.o
*.a
*.so
/pt-run
hugomg marked this conversation as resolved.
Show resolved Hide resolved
36 changes: 0 additions & 36 deletions .luacheckrc

This file was deleted.

23 changes: 15 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,35 @@
# Please refer to the LICENSE and AUTHORS files for details
# SPDX-License-Identifier: MIT

CC := gcc
CC := gcc
CFLAGS := -DPT_DEBUG -O2 -std=c99 -pedantic -Wall -Wextra

LUA_DIR := /usr

INSTALL_DIR := /usr/local
INSTALL_INCDIR := $(INSTALL_DIR)/include
INSTALL_LIBDIR := $(INSTALL_DIR)/lib
INSTALL_BINDIR := $(INSTALL_DIR)/bin

.PHONY: install ptracer_header libptracer uninstall clean
.PHONY: install ptracer_header pt-run libptracer uninstall clean

install: ptracer_header libptracer
cp libptracer.so $(INSTALL_LIBDIR)
install: ptracer_header pt-run
cp pt-run $(INSTALL_BINDIR)

# We need the `ptracer.h` header to be installed first.
ptracer_header:
cp lib/ptracer.h $(INSTALL_INCDIR)

libptracer:
$(CC) -fPIC -DPT_DEBUG -O2 -shared src/ptracer/main.c -o libptracer.so
pt-run:
$(CC) $(CFLAGS) src/pt-run/main.c -o pt-run -llua -lm -Wl,-E -L$(LUA_DIR)/lib
hugomg marked this conversation as resolved.
Show resolved Hide resolved

uninstall:
rm -rf $(INSTALL_INCDIR)/ptracer.h
rm -rf $(INSTALL_LIBDIR)/libptracer.so
rm -rf $(INSTALL_BINDIR)/pt-run

clean:
rm -rf ptinit/*.o
rm -rf examples/*/*.so
rm -rf spec/tracebacks/*/*.so
rm -rf *.so
rm -rf pt-run

Loading
Loading