diff --git a/BUGS b/BUGS deleted file mode 100644 index e69de29..0000000 diff --git a/README.md b/README.md index 80bcbca..413c5b0 100644 --- a/README.md +++ b/README.md @@ -113,17 +113,23 @@ when executed, the output will be: # Install ## 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 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 -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`. - -Once the CLI is installed, you'll be able to use the `c2html` command in your terminal. +If you also want to install it, run +```sh +sudo make install +``` +then you'll be able to use the `c2html` command in your terminal. # License This is free and unencumbered software released into the public domain. diff --git a/build.sh b/build.sh deleted file mode 100755 index 88cea4b..0000000 --- a/build.sh +++ /dev/null @@ -1 +0,0 @@ -gcc cli.c c2html.c -o c2html -Wall -Wextra -g \ No newline at end of file diff --git a/c2html.c b/c2html.c index 285a430..ee07866 100644 --- a/c2html.c +++ b/c2html.c @@ -439,6 +439,9 @@ static void buff_printf(buff_t *buff, const char *fmt, ...) int k = vsnprintf(buffer, n+1, fmt, va2); 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'); diff --git a/install.sh b/install.sh deleted file mode 100755 index 50164ea..0000000 --- a/install.sh +++ /dev/null @@ -1 +0,0 @@ -sudo cp c2html /bin/c2html \ No newline at end of file diff --git a/makefile b/makefile new file mode 100644 index 0000000..f613320 --- /dev/null +++ b/makefile @@ -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 \ No newline at end of file