summaryrefslogtreecommitdiff
path: root/src/Makefile
blob: 4450727489c8bcf6520252d974322d9147fba180 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
CC = gcc
SHELL = /usr/bin/env -S bash

# I need to get better at makefiles so I can write this in a way that isn't absolutely insane/stupid
# RELEASE_CFLAGS := -O3 -fipa-pta -fipa-cp -fuse-linker-plugin -flto=auto
# RELEASE_LDFLAGS := -fuse-linker-plugin -flto=auto

CFLAGS = -std=c2x -Wall -Wextra -Wpedantic -pedantic-errors -fanalyzer -Wanalyzer-too-complex -ggdb -g3 -O0 $$(pkg-config --cflags libsodium)
LDLIBS += $$(pkg-config --libs-only-l libsodium)
LDFLAGS += $$(pkg-config --libs-only-L libsodium)


BINARIES := main

.PHONY: all c clean val

all: main

main: main.o shared.o ll.o arena.o

ll.o: ll.c ll.h shared.h
main.o: main.c shared.h
arena.o: arena.c arena.h shared.h
shared.o: shared.c shared.h

c clean:
	rm -rvf $(BINARIES) $(wildcard *.o) $(wildcard *.test*) $(wildcard *.enc)

val:
	$(MAKE) all
	valgrind --leak-check=yes ./main