0 # Linux makefile

1 SHELL = /bin/sh

2

3 PREFIX = /usr

4 CC = cc

5

6 CFLAGS = -O2 -Wall -Wpedantic -Wextra -Wformat-truncation=0 -I./include

7 LDFLAGS = -s -L./lib -ltls -lcrypto -lm -lpthread -lssl -lanl -ldl -lpthread

8 # MUSL

9 #CFLAGS = -O2 -Wall -Wpedantic -Wextra -Wformat-truncation=0 -I./include -D__MUSL__

10 #LDFLAGS = -s -static -L./lib -ltls -lcrypto -lm -lpthread -lssl

11 # MacOS

12 #CFLAGS = -O2 -Wall -Wpedantic -Wextra -I./include

13 #LDFLAGS = -s -L./lib -ltls -lcrypto -lm -lpthread -lssl -ldl

14

15 FLAGS = -DTERMINAL_IMG_VIEWER -DHIDE_HOME

16

17 SRC = $(wildcard src/*.c)

18 OBJ = ${SRC:.c=.o}

19 OBJS = $(subst src,obj,$(OBJ))

20

21 .c.o:

22 mkdir -p obj

23 ${CC} -c ${CFLAGS} ${FLAGS} {body}lt; -o $(subst src,obj,${<:.c=.o})

24

25 vgmi: ${OBJ}

26 ${CC} -o $@ ${OBJS} ${LDFLAGS}

27

28 install:

29 cp vgmi ${PREFIX}/bin

30 chmod 755 ${PREFIX}/bin/vgmi

31

32 uninstall:

33 rm ${PREFIX}/bin/vgmi

34

35 clean:

36 rm vgmi ${OBJS}

37