feat: autotools (#10)
* start configure * ignore some files * wip configure * working configure * working with dev tools * rename automake -> release * update readme * update Makefile.dev
This commit is contained in:
+17
-1
@@ -1,4 +1,20 @@
|
||||
build
|
||||
.vscode
|
||||
*.bmp
|
||||
!images/*
|
||||
!images/*
|
||||
*.cache
|
||||
.deps
|
||||
Makefile
|
||||
*.log
|
||||
*.o
|
||||
.dirstamp
|
||||
aclocal.m4
|
||||
compile
|
||||
install-sh
|
||||
missing
|
||||
depcomp
|
||||
Makefile.in
|
||||
configure~
|
||||
config.status
|
||||
margen
|
||||
*.tar.gz
|
||||
@@ -0,0 +1,5 @@
|
||||
AUTOMAKE_OPTIONS = foreign subdir-objects -Wall
|
||||
bin_PROGRAMS = margen
|
||||
margen_SOURCES = src/main.c src/args.c src/bmp.c src/generator.c src/rand.c
|
||||
include_HEADERS = src/main.h src/args.h src/bmp.h src/generator.h src/rand.h src/config.h src/types.h
|
||||
margen_LDADD = -lm
|
||||
+7
-10
@@ -24,15 +24,12 @@ valgrind: build
|
||||
valgrind --leak-check=full -s ./build/$(TARGET) $(TEST_ARGS)
|
||||
|
||||
.PHONY: release
|
||||
release: clean build time
|
||||
@echo -n "Version (x.y.z): "
|
||||
@read VERSION; \
|
||||
sed -i "s/#define VERSION.*/#define VERSION \"v$$VERSION\"/g" ./src/const.h; \
|
||||
git add ./src/const.h; \
|
||||
git diff origin/master; \
|
||||
git commit -m "$(TARGET) v$$VERSION"; \
|
||||
git tag v$$VERSION -m "$(TARGET) v$$VERSION"
|
||||
@echo updated ./src/const.h and tagged version
|
||||
release:
|
||||
aclocal
|
||||
autoconf
|
||||
automake --add-missing
|
||||
./configure
|
||||
make distcheck
|
||||
|
||||
.PHONY: gif
|
||||
gif: build
|
||||
@@ -41,4 +38,4 @@ gif: build
|
||||
./build/margen -w=1920 -h=720 --seed=$$i$$i -o=tmp/image$$i.bmp ; \
|
||||
done
|
||||
ffmpeg -y -f image2 -framerate 1 -i tmp/image%d.bmp -vf scale=960x360 images/sample.gif
|
||||
rm -rf tmp
|
||||
rm -rf tmp
|
||||
@@ -10,13 +10,12 @@ Written in pure C without librairies.
|
||||
|
||||
## Install
|
||||
|
||||
You only need **gcc** and **make**.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/klemek/margen
|
||||
cd margen
|
||||
make clean build install
|
||||
# margen is now installed in ~/.local/bin
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
```
|
||||
|
||||
## CLI arguments
|
||||
@@ -41,7 +40,3 @@ options:
|
||||
-r, --rotation start corner rotation [0-3] (default: random)
|
||||
-m, --monochrome grayscale generation
|
||||
```
|
||||
|
||||
## TODO
|
||||
|
||||
- configure, make, make install
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
AC_INIT([margen], [1.1.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_CHECK_HEADERS([math.h])
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
#include "args.h"
|
||||
#include "const.h"
|
||||
#include "config.h"
|
||||
#include "rand.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -7,9 +7,9 @@
|
||||
#include <time.h>
|
||||
|
||||
void print_help(int status_code) {
|
||||
puts(NAME
|
||||
puts(PACKAGE
|
||||
" " VERSION "\n\n"
|
||||
"usage: " NAME " "
|
||||
"usage: " PACKAGE " "
|
||||
"[--help] "
|
||||
"[-v] "
|
||||
"[-q] "
|
||||
@@ -145,7 +145,7 @@ parameters parse_args(int argc, char **argv) {
|
||||
} else if (is_arg(arg, "-q") || is_arg(arg, "--quiet")) {
|
||||
params.quiet = true;
|
||||
} else if (is_arg(arg, "-v") || is_arg(arg, "--version")) {
|
||||
puts(NAME " " VERSION);
|
||||
puts(PACKAGE " " VERSION);
|
||||
exit(0);
|
||||
} else if (is_arg(arg, "-w") || is_arg(arg, "--width")) {
|
||||
params.width = parse_ushort(arg, value);
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#ifndef PACKAGE
|
||||
#define PACKAGE "margen"
|
||||
#endif
|
||||
|
||||
#ifndef VERSION
|
||||
#define VERSION "(dev)"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,7 +0,0 @@
|
||||
#ifndef CONST_H
|
||||
#define CONST_H
|
||||
|
||||
#define NAME "margen"
|
||||
#define VERSION "v1.1.0"
|
||||
|
||||
#endif
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
#include "args.h"
|
||||
#include "bmp.h"
|
||||
#include "const.h"
|
||||
#include "config.h"
|
||||
#include "rand.h"
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
@@ -104,7 +104,7 @@ void print_time(parameters params, clock_t start) {
|
||||
|
||||
void generate(parameters params) {
|
||||
if (!params.quiet) {
|
||||
puts(NAME " " VERSION);
|
||||
puts(PACKAGE " " VERSION);
|
||||
}
|
||||
clock_t start = clock();
|
||||
init(params);
|
||||
|
||||
Reference in New Issue
Block a user