Version v0.3.23 - Reorganized project structure - all sources in src/, builds in build/
This commit is contained in:
15
Makefile
15
Makefile
@@ -1,29 +1,32 @@
|
||||
CC = gcc
|
||||
CFLAGS = -Wall -Wextra -std=c99 -Iinclude
|
||||
CFLAGS = -Wall -Wextra -std=c99 -Isrc
|
||||
LIBS = -lm
|
||||
LIBS_STATIC = -static -lm
|
||||
TARGET = otp
|
||||
SOURCES = $(wildcard src/*.c) nostr_chacha20.c otp.c
|
||||
ARCH = $(shell uname -m)
|
||||
TARGET = build/otp-$(ARCH)
|
||||
SOURCES = $(wildcard src/*.c)
|
||||
OBJS = $(SOURCES:.c=.o)
|
||||
|
||||
# Default build target
|
||||
$(TARGET): $(OBJS)
|
||||
@mkdir -p build
|
||||
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
|
||||
|
||||
# Static linking target
|
||||
static: $(OBJS)
|
||||
@mkdir -p build
|
||||
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LIBS_STATIC)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET) $(OBJS) *.pad *.state
|
||||
rm -f $(OBJS) src/*.o build/otp-* *.pad *.state
|
||||
|
||||
install:
|
||||
sudo cp $(TARGET) /usr/local/bin/
|
||||
sudo cp $(TARGET) /usr/local/bin/otp
|
||||
|
||||
uninstall:
|
||||
sudo rm -f /usr/local/bin/$(TARGET)
|
||||
sudo rm -f /usr/local/bin/otp
|
||||
|
||||
.PHONY: clean install uninstall static
|
||||
|
||||
Reference in New Issue
Block a user