TARGET = stack_handling
LIBS =
CC = gcc
CFLAGS = -Wall -fomit-frame-pointer -fstack-check #-fsanitize=address

.PHONY: default all clean

default: $(TARGET)
all: default objdump

OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c))
HEADERS = $(wildcard *.h)GG

%.o: %.c $(HEADERS)
	$(CC) $(CFLAGS) -c $< -o $@

.PRECIOUS: $(TARGET) $(OBJECTS)

$(TARGET): $(OBJECTS)
	$(CC) $(OBJECTS) $(CFLAGS) $(LIBS) -o $@

clean:
	-rm -f *.o
	-rm -f $(TARGET)

objdump: $(TARGET)
	objdump --no-show-raw-insn --disassembler-options=intel-nmemonic -d $(TARGET) > $@