--- /dev/null
+image: debian/stable
+packages:
+ - build-essential
+ - cmake
+ - ninja-build
+ - pkg-config
+ - ncurses-dev
+ - libreadline-dev
+ - libedit-dev
+ - libgoogle-perftools-dev
+ - libgmp-dev
+ - libssl-dev
+ - unixodbc-dev
+ - zlib1g-dev
+ - libarchive-dev
+ - libossp-uuid-dev
+ - libxext-dev
+ - libice-dev
+ - libjpeg-dev
+ - libxinerama-dev
+ - libxft-dev
+ - libxpm-dev
+ - libxt-dev
+ - libdb-dev
+ - libpcre2-dev
+ - libyaml-dev
+ - zip
+ - git
+secrets:
+ - 750079bb-9735-473b-bebf-db897c9f0c6b
+ - 72d5c3dc-f83f-4cc2-96e3-b2b08f6ee8a0
+sources:
+ - git@git.sr.ht:~eshel/sweep
+tasks:
+ - build: |
+ cd sweep
+ make
+ make info
CURRENT_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
BASENAME = sweep
+
+UNAME_S := $(shell uname -s)
+ifeq ($(UNAME_S),Linux)
+ SOEXT = so
+endif
+ifeq ($(UNAME_S),Darwin)
+ SOEXT = dylib
+endif
+
SOEXT = dylib
TARGET = $(BASENAME)-module.$(SOEXT)
+OBJECT = $(BASENAME).o
SOURCE = $(BASENAME).c
LDFLAGS += -shared
all: $(TARGET)
-$(TARGET): $(SOURCE) swipl
- $(CC) $(CFLAGS) -o $@ $(SOURCE) $(LDFLAGS)
+$(OBJECT): $(SOURCE) lib/libswipl.$(SOEXT)
+ $(CC) $(CFLAGS) -o $@ -c $(SOURCE)
+
+$(TARGET): $(OBJECT)
+ $(CC) -o $@ $(OBJECT) $(LDFLAGS)
clean:
rm -rf bin lib share swipl/build
- rm -f $(TARGET) $(BASENAME).info
+ rm -f $(TARGET) $(OBJECT) $(BASENAME).info
-swipl:
+lib/libswipl.$(SOEXT):
cd swipl; \
rm -rf build; \
mkdir build; \
ninja; \
ninja install
-$(BASENAME).info:
+$(BASENAME).info:: README.org
emacs -Q --batch --eval '(require (quote ox-texinfo))' --eval "(with-current-buffer (find-file \"README.org\") (org-export-to-file (quote texinfo) \"$@\" nil nil nil nil nil (quote org-texinfo-compile)))"