initial commit
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
*.c text eol=lf diff=cpp whitespace=trailing-space,space-before-tab,tab-in-indent
|
||||
*.h text eol=lf diff=cpp whitespace=trailing-space,space-before-tab,tab-in-indent
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
build
|
||||
.vscode
|
||||
*.bmp
|
||||
!images/*
|
||||
*.cache
|
||||
.deps
|
||||
Makefile
|
||||
*.log
|
||||
*.o
|
||||
.dirstamp
|
||||
aclocal.m4
|
||||
compile
|
||||
install-sh
|
||||
missing
|
||||
depcomp
|
||||
Makefile.in
|
||||
configure~
|
||||
config.status
|
||||
margen
|
||||
*.tar.gz
|
||||
configure
|
||||
src/margen*
|
||||
*.pkg.tar.zst
|
||||
pkg
|
||||
@@ -0,0 +1,4 @@
|
||||
AUTOMAKE_OPTIONS = foreign subdir-objects -Wall
|
||||
bin_PROGRAMS = forge
|
||||
forge_SOURCES = src/main.c src/args.c
|
||||
include_HEADERS = src/main.h src/args.h src/config.h src/types.h
|
||||
@@ -0,0 +1,39 @@
|
||||
TARGET ?= forge
|
||||
INSTALL_DIR ?= $(HOME)/.local/bin
|
||||
TEST_ARGS ?=
|
||||
SHELL := /bin/bash
|
||||
|
||||
.PHONY: build
|
||||
clean:
|
||||
@rm -rf build
|
||||
|
||||
build:
|
||||
@mkdir -p build
|
||||
gcc -Wall src/*.c src/*.h -lm -o build/$(TARGET)
|
||||
|
||||
.PHONY: install
|
||||
install: build
|
||||
cp -f build/$(TARGET) $(INSTALL_DIR)/$(TARGET)
|
||||
|
||||
.PHONY: time
|
||||
time: build
|
||||
time ./build/$(TARGET) $(TEST_ARGS)
|
||||
|
||||
.PHONY: valgrind
|
||||
valgrind: build
|
||||
valgrind --leak-check=full -s ./build/$(TARGET) $(TEST_ARGS)
|
||||
|
||||
.PHONY: release
|
||||
release:
|
||||
aclocal
|
||||
autoconf
|
||||
automake --add-missing
|
||||
./configure
|
||||
make distcheck
|
||||
|
||||
.PHONY: release-arch
|
||||
release-arch: clean
|
||||
mkdir -p build
|
||||
cp PKGBUILD build
|
||||
cd build && makepkg
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
pkgname=forge
|
||||
pkgver=0.0.0
|
||||
pkgrel=1
|
||||
pkgdesc="Fusion Of Real Time Generative Effects"
|
||||
arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64' 'riscv64')
|
||||
url="https://github.com/klemek/forge"
|
||||
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/klemek/forge/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
|
||||
sha256sums=('TODO')
|
||||
srcdir=build
|
||||
|
||||
build() {
|
||||
cd "$srcdir/$pkgname-$pkgver"
|
||||
./configure --prefix=/usr
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir/$pkgname-$pkgver"
|
||||
sudo make DESTDIR="$pkgdir" install
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
# forge
|
||||
|
||||
> **F**usion **O**f **R**eal **T**ime **G**enerative **E**ffects
|
||||
|
||||
TODO
|
||||
|
||||
## Install
|
||||
|
||||
### From release
|
||||
|
||||
See [Releases](https://github.com/klemek/forge/releases)
|
||||
|
||||
```sh
|
||||
tar xvzf forge-x.y.z.tar.gz
|
||||
cd forge-x.y.z
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
```
|
||||
|
||||
### From repository (PKGBUILD)
|
||||
|
||||
```sh
|
||||
git clone https://github.com/klemek/forge
|
||||
cd forge
|
||||
forge -si
|
||||
```
|
||||
|
||||
|
||||
### From repository (dev version)
|
||||
|
||||
```sh
|
||||
git clone https://github.com/klemek/forge
|
||||
cd forge
|
||||
aclocal
|
||||
autoconf
|
||||
automake --add-missing
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
```
|
||||
|
||||
## CLI arguments
|
||||
|
||||
```txt
|
||||
usage: forge [--help] [-v]
|
||||
|
||||
Fusion Of Real-time Generative Effects.
|
||||
|
||||
options:
|
||||
--help show this help message and exit
|
||||
-v, --version print version
|
||||
```
|
||||
|
||||
## Release guide
|
||||
|
||||
```bash
|
||||
# update configure.ac with new version
|
||||
$EDITOR configure.ac
|
||||
# make full build
|
||||
make -f Makefile.dev release
|
||||
# push to repo
|
||||
git commit -am "forge vX.Y.Z"
|
||||
git tag vX.Y.Z
|
||||
git push origin master --tags
|
||||
# create release from tag on github
|
||||
# update PKGBUILD with new sha256 sum
|
||||
sha256sum forge-x.y.z.tar.gz
|
||||
make -f Makefile.dev release-arch
|
||||
git commit -am "update arch sha256"
|
||||
# add .pkg.tar.zst on the release
|
||||
```
|
||||
|
||||
## Roadmap
|
||||
|
||||
TODO
|
||||
@@ -0,0 +1,10 @@
|
||||
AC_INIT([forge], [0.0.0], [klemek.dev@proton.me])
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_PROG_CC
|
||||
AC_CHECK_HEADERS([stdio.h])
|
||||
AC_CHECK_HEADERS([stdlib.h])
|
||||
AC_CHECK_HEADERS([stdbool.h])
|
||||
AC_CHECK_HEADERS([string.h])
|
||||
AC_CHECK_HEADERS([time.h])
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
#include "args.h"
|
||||
#include "config.h"
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
void print_help(int status_code) {
|
||||
puts(PACKAGE " " VERSION "\n\n"
|
||||
"usage: " PACKAGE " "
|
||||
"[--help] "
|
||||
"[-v] "
|
||||
"\n\n"
|
||||
"Fusion Of Real-time Generative Effects.\n\n"
|
||||
"options:\n"
|
||||
" --help show this help message and exit\n"
|
||||
" -v, --version print version\n");
|
||||
exit(status_code);
|
||||
}
|
||||
|
||||
void invalid_arg(char *arg) {
|
||||
fprintf(stderr, "invalid argument: '%s'\n\n", arg);
|
||||
print_help(1);
|
||||
}
|
||||
|
||||
bool is_arg(char *arg, char *ref) { return strcoll(arg, ref) == 0; }
|
||||
|
||||
char *split_arg_value(char *arg) {
|
||||
strtok(arg, "=");
|
||||
return strtok(NULL, "=");
|
||||
}
|
||||
|
||||
parameters parse_args(int argc, char **argv) {
|
||||
parameters params;
|
||||
|
||||
int i;
|
||||
char *arg;
|
||||
char *value;
|
||||
for (i = 1; i < argc; i++) {
|
||||
arg = argv[i];
|
||||
value = split_arg_value(arg);
|
||||
if (is_arg(arg, "--help")) {
|
||||
print_help(0);
|
||||
} else if (is_arg(arg, "-v") || is_arg(arg, "--version")) {
|
||||
puts(PACKAGE " " VERSION);
|
||||
exit(0);
|
||||
} else {
|
||||
invalid_arg(arg);
|
||||
}
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include "types.h"
|
||||
|
||||
#ifndef ARGS_H
|
||||
#define ARGS_H
|
||||
|
||||
parameters parse_args(int argc, char **argv);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#ifndef PACKAGE
|
||||
#define PACKAGE "forge"
|
||||
#endif
|
||||
|
||||
#ifndef VERSION
|
||||
#define VERSION "(dev)"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,8 @@
|
||||
#include "args.h"
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
parameters params;
|
||||
params = parse_args(argc, argv);
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
#ifndef MAIN_H
|
||||
#define MAIN_H
|
||||
|
||||
#endif
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
#ifndef TYPES_H
|
||||
#define TYPES_H
|
||||
|
||||
struct Parameters {
|
||||
// TODO
|
||||
};
|
||||
|
||||
typedef struct Parameters parameters;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user