Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
38129eb856 | |||
55a599a88e |
7 changed files with 34 additions and 24 deletions
|
@ -1,24 +0,0 @@
|
|||
name: Build
|
||||
on: pull_request
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y cmake \
|
||||
make \
|
||||
gcc \
|
||||
g++ \
|
||||
autoconf \
|
||||
libtool \
|
||||
libcurl4-openssl-dev \
|
||||
libssl-dev \
|
||||
libjson-c-dev
|
||||
- name: Build
|
||||
run: |
|
||||
cmake -DPIHELPER_EXECUTABLE=BOOL:ON -B build
|
||||
cmake --build build
|
24
Makefile
Normal file
24
Makefile
Normal file
|
@ -0,0 +1,24 @@
|
|||
C_FILES = $(wildcard src/*.c)
|
||||
O_FILES = $(C_FILES:src/%.c=build/%.o)
|
||||
|
||||
.PHONY: all clean
|
||||
.DEFAULT: all
|
||||
|
||||
all: pihelper
|
||||
|
||||
libpihelper: $(O_FILES)
|
||||
gcc -o $@ $^
|
||||
|
||||
pihelper: libpihelper
|
||||
gcc -o $@ $^
|
||||
|
||||
build:
|
||||
@mkdir -p build
|
||||
|
||||
build/%.o: src/%.c | build
|
||||
gcc -c $< -o $@
|
||||
|
||||
clean:
|
||||
-rm -f $(O_FILES)
|
||||
-rm -f pihelper
|
||||
-rm -rf build
|
10
meson.build
Normal file
10
meson.build
Normal file
|
@ -0,0 +1,10 @@
|
|||
project('pihelper', 'c')
|
||||
crypto = dependency('libcrypto')
|
||||
curl = dependency('libcurl')
|
||||
jsonc = dependency('json-c')
|
||||
ssl = dependency('libssl')
|
||||
incdir = include_directories('include')
|
||||
lib_dependencies = [ crypto, curl, ssl, jsonc ]
|
||||
lib_sources = [ 'src/config.c', 'src/log.c', 'src/network.c', 'src/pihelper.c' ]
|
||||
lib = library('pihelper', lib_sources, include_directories: incdir, dependencies: lib_dependencies)
|
||||
executable('pihelper', ['src/cli.h', 'src/cli.c'], link_with: lib, include_directories: incdir)
|
Loading…
Reference in a new issue