diff options
| author | bryan <bryan@veltar.systems> | 2026-08-26 15:16:23 +0200 |
|---|---|---|
| committer | bryan <bryan@veltar.systems> | 2026-08-26 15:16:23 +0200 |
| commit | 22ade138c4e83b7c0b0c702c38c0ca00a9948d4b (patch) | |
| tree | f78768a69dded978be14aa4290b198903b27f4c0 /Makefile | |
| parent | dfce501af03595a8fb5083fbc43b48d729ae9551 (diff) | |
| download | rg-22ade138c4e83b7c0b0c702c38c0ca00a9948d4b.tar.gz rg-22ade138c4e83b7c0b0c702c38c0ca00a9948d4b.zip | |
Replace the placeholder with a suckless C rg.
rg prints n cryptographically random strings of length l, matching
rg.veltar.systems. Bytes come from getrandom(2) on Linux and rand_s
on Windows. make selects clang and .exe when OS=Windows_NT.
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..19ecfb6 --- /dev/null +++ b/Makefile @@ -0,0 +1,51 @@ +# See LICENSE file for copyright and license details. +# rg - random string generator + +include config.mk + +SRC = rg.c +OBJ = ${SRC:.c=.o} + +all: options rg${EXE} + +options: + @echo rg build options: + @echo "CFLAGS = ${CFLAGS}" + @echo "LDFLAGS = ${LDFLAGS}" + @echo "CC = ${CC}" + +config.h: + cp config.def.h $@ + +.c.o: + ${CC} -c ${CFLAGS} $< + +${OBJ}: arg.h config.h config.mk + +rg${EXE}: ${OBJ} + ${CC} -o $@ ${OBJ} ${LDFLAGS} + +clean: + rm -f rg rg.exe ${OBJ} rg-${VERSION}.tar.gz + +dist: clean + mkdir -p rg-${VERSION} + cp -R LICENSE Makefile README arg.h config.def.h config.mk \ + rg.c rg.1 rg-${VERSION} + tar -cf - rg-${VERSION} | gzip -c > rg-${VERSION}.tar.gz + rm -rf rg-${VERSION} + +install: all + mkdir -p ${DESTDIR}${PREFIX}/bin + cp -f rg${EXE} ${DESTDIR}${PREFIX}/bin + chmod 755 ${DESTDIR}${PREFIX}/bin/rg${EXE} + mkdir -p ${DESTDIR}${MANPREFIX}/man1 + sed "s/VERSION/${VERSION}/g" < rg.1 > ${DESTDIR}${MANPREFIX}/man1/rg.1 + chmod 644 ${DESTDIR}${MANPREFIX}/man1/rg.1 + +uninstall: + rm -f ${DESTDIR}${PREFIX}/bin/rg \ + ${DESTDIR}${PREFIX}/bin/rg.exe \ + ${DESTDIR}${MANPREFIX}/man1/rg.1 + +.PHONY: all options clean dist install uninstall |
