Implement full AppImage packaging support including AppRun entry point, .desktop launcher, icon asset, and recursive shared library collection via collect_so_files.sh. The Makefile build target now generates a portable Linux executable by assembling the directory structure, copying the binary to AppImage/usr/bin/r, running the dependency collector, and invoking appimagetool to produce a self-contained AppImage binary. Also update .gitignore to exclude the AppImage build directory and add shell scripts to the ignore list.
61 lines
1.3 KiB
Makefile
61 lines
1.3 KiB
Makefile
all: build build_rpylib run build_mingw
|
|
|
|
# Variables for compiler and flags
|
|
CC = gcc
|
|
CFLAGS = -Ofast -Werror -Wall -lreadline -lncurses -lcurl -lgnutls -ljson-c -lsqlite3 -lm $(pkg-config --cflags --libs gnutls gmp) -lnettle -lssl -lcrypto
|
|
|
|
# MinGW Variables
|
|
MINGW_CC = x86_64-w64-mingw32-gcc # Change to x86_64-w64-mingw32-gcc for 64-bit
|
|
MINGW_CFLAGS = -Ofast -Werror -Wall -lreadline -lcurl -lssl -lcrypto -ljson-c -lm -lglob
|
|
|
|
# Targets
|
|
build:
|
|
$(CC) main.c $(CFLAGS) -o bin/r
|
|
-@rm -rf AppImage
|
|
mkdir -p AppImage
|
|
mkdir -p AppImage/usr
|
|
mkdir -p AppImage/usr/bin
|
|
mkdir -p AppImage/lib
|
|
cp AppRun AppImage/AppRun
|
|
cp r.desktop AppImage/r.desktop
|
|
cp r.png AppImage/r.png
|
|
cp bin/r AppImage/usr/bin/r
|
|
./collect_so_files.sh
|
|
#./prepare_app_image AppImage/usr/bin/r AppImage
|
|
appimagetool-x86_64.AppImage AppImage
|
|
mv r-x86_64.AppImage r
|
|
|
|
publish:
|
|
-@publish r
|
|
|
|
build_rpylib:
|
|
$(CC) -shared -o rpylib.so -fPIC rpylib.c -lpython3.12 `python3-config --includes` -I/usr/include/CL -ljson-c -lcurl -lsqlite3
|
|
publish rpylib.so
|
|
|
|
# New MinGW build target
|
|
build_mingw:
|
|
$(MINGW_CC) main.c $(MINGW_CFLAGS) -o r.exe
|
|
publish r.exe
|
|
|
|
run:
|
|
./r --verbose
|
|
|
|
run_free:
|
|
./rf --verbose
|
|
|
|
run_rd:
|
|
./rd --verbose
|
|
|
|
run_mingw:
|
|
./r.exe --verbose
|
|
|
|
|
|
|
|
docker: docker_make docker_run
|
|
|
|
docker_make:
|
|
docker build -t r .
|
|
|
|
docker_run:
|
|
docker run -v .:/app --rm -it r
|