Go Back

0 # Linux makefile

1 SHELL = /bin/sh

2

3 PREFIX = /usr

4 CC = cc

5

6 CFLAGS = -ansi -std=c89 -O2 -Wall -Wpedantic -Wextra \

7 -I./include -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE

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

9 # MacOS

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

11

12 FLAGS = -DENABLE_SECCOMP_FILTER

13

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

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

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

17

18 .c.o:

19 mkdir -p obj

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

21

22 vgmi: ${OBJ}

23 ${CC} -O2 -c -o obj/stb_image.o -I./include stb_image/stb_image.c

24 ${CC} -o $@ obj/stb_image.o ${OBJS} ${LDFLAGS}

25

26 install:

27 cp vgmi ${PREFIX}/bin

28 chmod 755 ${PREFIX}/bin/vgmi

29

30 uninstall:

31 rm ${PREFIX}/bin/vgmi

32

33 clean:

34 rm vgmi ${OBJS}

35