Skip to content

Commit

Permalink
Add doc to readme how to build.
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddenalpha committed Apr 23, 2024
1 parent 97850a9 commit 1c837a1
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 19 deletions.
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

CC=gcc
LD=gcc
CC=cc
LD=cc
MKDIR_P=mkdir -p
RIMRAF=rm -rf
COPYTO=cp -t
Expand All @@ -12,9 +12,7 @@ INSTALL_ROOT=/usr/local

CFLAGS=-Wall -Werror -pedantic -std=c89 -fPIC -Os -fmax-errors=1 -DPROJECT_VERSION=$(PROJECT_VERSION) -D_POSIX_C_SOURCE=200112L

LDFLAGS=-Wl,-s,--as-needed,--gc-sections,-pie

LIBS=-dy -lc
LDFLAGS=-Wl,-s,--as-needed,--gc-sections,-pie,-dy,-lc

PROJECT_VERSION=$(shell (git describe --tags 2>/dev/null|sed 's,^v,,'|egrep .) || date -u +0.0.0-%Y%m%d.%H%M%S)

Expand All @@ -34,7 +32,7 @@ build/bin/getaddrinfo$(BINEXT):
build/bin/getaddrinfo$(BINEXT): build/obj/main/c/getaddrinfocli.o
echo " LN $@"
$(MKDIR_P) "$(shell dirname "$@")"
$(LD) -o "$@" $(LDFLAGS) $^ $(LIBS)
$(LD) -o "$@" $^ $(LDFLAGS)

build/obj/main/c/getaddrinfocli.o:
build/obj/main/c/getaddrinfocli.o: src/main/c/getaddrinfocli.c
Expand Down
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

getaddrinfo-cli
===============

Simple commandline frontend for [getaddrinfo](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html).

[Home](https://git.hiddenalpha.ch/getaddrinfo-cli.git/tree/README.txt).

[Downloads](https:/hiddenalpha/getaddrinfo-cli/releases).



## Build/Install From Source

Make sure you have at least:
- C compiler
- libc
- make

Then take a look if you need to tune anything in the Makefile.

Then to build do:
```sh
make clean
make
```

And to install:
```sh
make install
```

Or install even simpler:
```sh
tar -C /usr/local -xzf path/to/dist/your-build.tgz -- bin
```

13 changes: 0 additions & 13 deletions README.txt

This file was deleted.

0 comments on commit 1c837a1

Please sign in to comment.