makefile instead of shell scripts

This commit is contained in:
cozis
2022-05-08 15:51:59 +02:00
parent 5b016e5b2f
commit 96921385fa
6 changed files with 30 additions and 7 deletions
View File
+11 -5
View File
@@ -113,17 +113,23 @@ when executed, the output will be:
# Install # Install
## Supported platforms ## Supported platforms
The code is very portable so it's possible to run it everywhere, although there are only build and install scripts for \*nix systems. The code is very portable so it's possible to run it everywhere, although the build proces was only tested on Linux.
## Install the library ## Install the library
There is no particular way to install the library. The code is so small that you can just drop `c2html.c` and `c2html.h` in your project and use then as they were your own. There is no particular way to install the library. The code is so small that you can just drop `c2html.c` and `c2html.h` in your project and use then as they were your own.
## Install the command-line interface ## Install the command-line interface
To install the `c2html` command under **linux**, you first have to build it by running `build.sh`, then you can install it with `install.sh`. To build the CLI, run
```sh
make c2html
```
which will build the CLI executable `c2html`.
You may need to give these scripts execution privileges first. You can do that by running `chmod +x build.sh` and `chmod +x install.sh`. If you also want to install it, run
```sh
Once the CLI is installed, you'll be able to use the `c2html` command in your terminal. sudo make install
```
then you'll be able to use the `c2html` command in your terminal.
# License # License
This is free and unencumbered software released into the public domain. This is free and unencumbered software released into the public domain.
-1
View File
@@ -1 +0,0 @@
gcc cli.c c2html.c -o c2html -Wall -Wextra -g
+3
View File
@@ -439,6 +439,9 @@ static void buff_printf(buff_t *buff, const char *fmt, ...)
int k = vsnprintf(buffer, n+1, fmt, va2); int k = vsnprintf(buffer, n+1, fmt, va2);
assert(k >= 0 && k == n); assert(k >= 0 && k == n);
(void) k; // If asserts are deactivated by defining
// NDEBUG, the compiler complains because
// k is unused.
} }
assert(buffer[n] == '\0'); assert(buffer[n] == '\0');
-1
View File
@@ -1 +0,0 @@
sudo cp c2html /bin/c2html
+16
View File
@@ -0,0 +1,16 @@
CC = gcc
CFLAGS = -Wall -Wextra -DNDEBUG -O3
# CFLAGS = -Wall -Wextra -g # When debugging
.PHONY: all install clean
all: c2html
c2html: cli.c c2html.c c2html.h
$(CC) cli.c c2html.c -o $@ $(CFLAGS)
install: c2html
cp c2html /bin/c2html
clean:
rm c2html