Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3a100080c2 | |||
| 7626f99e32 |
+16
@@ -2,3 +2,19 @@ build
|
|||||||
.vscode
|
.vscode
|
||||||
*.bmp
|
*.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
|
||||||
@@ -24,15 +24,12 @@ valgrind: build
|
|||||||
valgrind --leak-check=full -s ./build/$(TARGET) $(TEST_ARGS)
|
valgrind --leak-check=full -s ./build/$(TARGET) $(TEST_ARGS)
|
||||||
|
|
||||||
.PHONY: release
|
.PHONY: release
|
||||||
release: clean build time
|
release:
|
||||||
@echo -n "Version (x.y.z): "
|
aclocal
|
||||||
@read VERSION; \
|
autoconf
|
||||||
sed -i "s/#define VERSION.*/#define VERSION \"v$$VERSION\"/g" ./src/const.h; \
|
automake --add-missing
|
||||||
git add ./src/const.h; \
|
./configure
|
||||||
git diff origin/master; \
|
make distcheck
|
||||||
git commit -m "$(TARGET) v$$VERSION"; \
|
|
||||||
git tag v$$VERSION -m "$(TARGET) v$$VERSION"
|
|
||||||
@echo updated ./src/const.h and tagged version
|
|
||||||
|
|
||||||
.PHONY: gif
|
.PHONY: gif
|
||||||
gif: build
|
gif: build
|
||||||
@@ -10,13 +10,12 @@ Written in pure C without librairies.
|
|||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
You only need **gcc** and **make**.
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/klemek/margen
|
git clone https://github.com/klemek/margen
|
||||||
cd margen
|
cd margen
|
||||||
make clean build install
|
./configure
|
||||||
# margen is now installed in ~/.local/bin
|
make
|
||||||
|
make install
|
||||||
```
|
```
|
||||||
|
|
||||||
## CLI arguments
|
## CLI arguments
|
||||||
@@ -41,7 +40,3 @@ options:
|
|||||||
-r, --rotation start corner rotation [0-3] (default: random)
|
-r, --rotation start corner rotation [0-3] (default: random)
|
||||||
-m, --monochrome grayscale generation
|
-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.2.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 "args.h"
|
||||||
#include "const.h"
|
#include "config.h"
|
||||||
#include "rand.h"
|
#include "rand.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -7,9 +7,9 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
void print_help(int status_code) {
|
void print_help(int status_code) {
|
||||||
puts(NAME
|
puts(PACKAGE
|
||||||
" " VERSION "\n\n"
|
" " VERSION "\n\n"
|
||||||
"usage: " NAME " "
|
"usage: " PACKAGE " "
|
||||||
"[--help] "
|
"[--help] "
|
||||||
"[-v] "
|
"[-v] "
|
||||||
"[-q] "
|
"[-q] "
|
||||||
@@ -145,7 +145,7 @@ parameters parse_args(int argc, char **argv) {
|
|||||||
} else if (is_arg(arg, "-q") || is_arg(arg, "--quiet")) {
|
} else if (is_arg(arg, "-q") || is_arg(arg, "--quiet")) {
|
||||||
params.quiet = true;
|
params.quiet = true;
|
||||||
} else if (is_arg(arg, "-v") || is_arg(arg, "--version")) {
|
} else if (is_arg(arg, "-v") || is_arg(arg, "--version")) {
|
||||||
puts(NAME " " VERSION);
|
puts(PACKAGE " " VERSION);
|
||||||
exit(0);
|
exit(0);
|
||||||
} else if (is_arg(arg, "-w") || is_arg(arg, "--width")) {
|
} else if (is_arg(arg, "-w") || is_arg(arg, "--width")) {
|
||||||
params.width = parse_ushort(arg, value);
|
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 "args.h"
|
||||||
#include "bmp.h"
|
#include "bmp.h"
|
||||||
#include "const.h"
|
#include "config.h"
|
||||||
#include "rand.h"
|
#include "rand.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -104,7 +104,7 @@ void print_time(parameters params, clock_t start) {
|
|||||||
|
|
||||||
void generate(parameters params) {
|
void generate(parameters params) {
|
||||||
if (!params.quiet) {
|
if (!params.quiet) {
|
||||||
puts(NAME " " VERSION);
|
puts(PACKAGE " " VERSION);
|
||||||
}
|
}
|
||||||
clock_t start = clock();
|
clock_t start = clock();
|
||||||
init(params);
|
init(params);
|
||||||
|
|||||||
Reference in New Issue
Block a user