Files
otp/Makefile

30 lines
581 B
Makefile

CC = gcc
CFLAGS = -Wall -Wextra -std=c99 -Iinclude
LIBS = -lm
LIBS_STATIC = -static -lm
TARGET = otp
SOURCES = $(wildcard src/*.c) nostr_chacha20.c otp.c
OBJS = $(SOURCES:.c=.o)
# Default build target
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
# Static linking target
static: $(OBJS)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LIBS_STATIC)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f $(TARGET) $(OBJS) *.pad *.state
install:
sudo cp $(TARGET) /usr/local/bin/
uninstall:
sudo rm -f /usr/local/bin/$(TARGET)
.PHONY: clean install uninstall static