Skip to content

Commit

Permalink
Make build system pack-compatible.
Browse files Browse the repository at this point in the history
  • Loading branch information
ReilySiegel committed Oct 30, 2024
1 parent 3209050 commit 40fa4ee
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 159 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/ci-lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@ jobs:
- name: Checkout idris2-tls
uses: actions/checkout@v2

- name: Install idris deps
run: pack install-deps tls.ipkg

- name: Build package
run: make install
run: pack --no-prompt install tls

- name: Test package
run: make test
run: pack --no-prompt run tls-tests

# windows-chez:
# runs-on: windows-latest
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ build/
*.o
*.dll
*.dylib
/lib/
/support/libidristls
36 changes: 0 additions & 36 deletions Makefile

This file was deleted.

34 changes: 0 additions & 34 deletions c/Makefile

This file was deleted.

50 changes: 0 additions & 50 deletions c/config.mk

This file was deleted.

9 changes: 9 additions & 0 deletions pack.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[custom.all.tls]
type = "local"
path = "."
ipkg = "tls.ipkg"

[custom.all.tls-tests]
type = "local"
path = "tests"
ipkg = "tlstest.ipkg"
37 changes: 37 additions & 0 deletions support/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
TARGET = libidristls
TARGET_VERSION ?= 0.0.1

INSTALLDIR = ../lib

LDFLAGS =
CPPFLAGS =

CC_VERSION = $(shell $(CC) --version)

ifeq ($(findstring clang,$(CC_VERSION)),clang)
DYLIB_WORKAROUND = cp "${INSTALLDIR}/${TARGET}" "${INSTALLDIR}/${TARGET}.dylib"
else
DYLIB_WORKAROUND = cp "${INSTALLDIR}/${TARGET}" "${INSTALLDIR}/${TARGET}.so"
LDFLAGS += -fuse-ld=gold
endif

SRCS = $(wildcard *.c)
OBJS = $(SRCS:.c=.o)

all: $(TARGET)

$(TARGET): $(OBJS)
$(CC) -shared $(LDFLAGS) -o $@ $^

.PHONY: clean

clean :
rm -f $(OBJS) $(TARGET)
rm -rf $(INSTALLDIR)

.PHONY: install

install:
mkdir -p $(INSTALLDIR)
install $(TARGET) $(wildcard *.h) $(INSTALLDIR)
$(DYLIB_WORKAROUND)
File renamed without changes.
34 changes: 0 additions & 34 deletions tests/Makefile

This file was deleted.

5 changes: 5 additions & 0 deletions tls.ipkg
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,9 @@ modules = Crypto.RSA,
Utils.ConstantTable

opts = "-Wno-shadowing"

sourcedir = "src"

prebuild = "make -C support all"

preinstall = "make -C support install"

0 comments on commit 40fa4ee

Please sign in to comment.