htg-public/cpp/makefile

36 lines
535 B
Makefile
Raw Normal View History

# var
CC = gcc
CFLAGS = -Wall -std=c11 -g -fno-stack-protector -z execstack
CANARY = -Wall -std=c11 -g -fstack-protector --param ssp-buffer-size=64
AFLAGS = -S -Wall -std=c11 -g
RM = /bin/rm
# src, .o, .out
SRC = ${wildcard *.c}
ASM = ${SRC:.c=.s}
OBJ = ${SRC:.c=.o}
ELF = ${SRC:.c=.out}
# targets
all: ${ELF}
2018-11-04 19:45:09 +01:00
:
asm: ${ASM}
2018-11-04 19:45:09 +01:00
:
# rules
${ELF}: ${OBJ}
2018-11-04 19:45:09 +01:00
${CC} ${OBJ} -o ${ELF}
# object
%.o: %.c
2018-11-04 19:45:09 +01:00
${CC} -c ${CFLAGS} $< -o $@
%.s: %.c
2018-11-04 19:45:09 +01:00
${CC} ${AFLAGS} $< -o $@
# cleanall
clean:
2018-11-04 19:45:09 +01:00
${RM} -f ${ELF} ${OBJ} ${ASM}