Tidied up code, removed obsolete getpass and implemented replacement

This commit is contained in:
Ignacio Rivero
2024-04-03 01:09:46 -03:00
parent 072db09093
commit a0c81e7064
2 changed files with 71 additions and 30 deletions

View File

@@ -1,12 +1,22 @@
salty: salty.o
cc ./build/salty.o -o ./build/salty -lsodium -I.
rm ./build/salty.o
CC = gcc
CFLAGS = -Wall -Wextra -std=c99 -O2
LDFLAGS = -lsodium
BUILD_DIR = build
PREFIX = /usr/local
salty.o: build
cc -c salty.c -o ./build/salty.o -lsodium -I.
all: $(BUILD_DIR)/salty
build:
mkdir -p ./build
$(BUILD_DIR)/salty: salty.c pawstd.h | $(BUILD_DIR)
$(CC) $(CFLAGS) -o $@ salty.c $(LDFLAGS)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
clean:
rm -rf $(BUILD_DIR)
install:
install -m 755 ./build/salty /usr/local/bin/salty
install -m 755 $(BUILD_DIR)/salty /usr/local/bin/salty
uninstall:
rm $(PREFIX)/bin/salty