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
Changes from 1 commit
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
Next Next commit
New Pallene Tracer pt-run implementation
singul4ri7y committed Aug 8, 2024
commit 0e0e6ce005c22ad38218c2e1d014871b96cb3045
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -51,7 +51,6 @@ jobs:
- name: Build
run: |
sudo make install
luarocks --local make

- name: Install Busted
run: luarocks --local install busted
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
36 changes: 0 additions & 36 deletions .luacheckrc

This file was deleted.

23 changes: 18 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -3,28 +3,41 @@
# 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
install: ptracer_header pt-run libptracer
strip -s pt-run
cp pt-run $(INSTALL_BINDIR)
strip -s libptracer.so
cp libptracer.so $(INSTALL_LIBDIR)

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

pt-run:
$(CC) $(CFLAGS) src/pt-run/main.c -o pt-run -llua -lm -Wl,-E -L$(LUA_DIR)/lib

libptracer:
$(CC) -fPIC -DPT_DEBUG -O2 -shared src/ptracer/main.c -o libptracer.so
$(CC) -fPIC -shared $(CFLAGS) src/ptracer/main.c -o libptracer.so

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

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

Loading