Skip to content

Commit

Permalink
Merge pull request #12 from pallene-lang/dev
Browse files Browse the repository at this point in the history
`pt-run` command implementation using Lua C API
  • Loading branch information
hugomg authored Aug 9, 2024
2 parents 806350b + 380b8d1 commit 1ca3b74
Show file tree
Hide file tree
Showing 23 changed files with 536 additions and 465 deletions.
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
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

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

0 comments on commit 1ca3b74

Please sign in to comment.