summaryrefslogtreecommitdiff
path: root/src/Makefile
blob: c5a08c7ccbcaac30e60c93a088a23cf4d0c95e5c (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
32
33
34
CC = gcc
SHELL = /usr/bin/bash

DEBUG_CFLAGS := -fanalyzer -Wanalyzer-too-complex -ggdb -g3 -O0
RELEASE_CFLAGS := -O3 -fipa-pta -fipa-cp -fuse-linker-plugin -flto=auto
CFLAGS = -Wall -Wextra -Wpedantic -pedantic-errors $(DEBUG_CFLAGS) $$(pkg-config --cflags libsodium)

DEBUG_LDLIBS :=
RELEASE_LDLIBS :=
LDLIBS += $(DEBUG_LDLIBS) $$(pkg-config --libs-only-l libsodium)

DEBUG_LDFLAGS :=
RELEASE_LDFLAGS := -fuse-linker-plugin -flto=auto
LDFLAGS += $(DEBUG_LDFLAGS) $$(pkg-config --libs-only-L libsodium)


BINARIES := main encryption

.PHONY: all clean

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

encryption: encryption.c encryption.h shared.o shared.h
ll: ll.o shared.o

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