cpp_prac/config.mk
2025-01-10 08:15:31 +01:00

30 lines
456 B
Makefile

CXXFLAGS ?= -Wall -Wextra -O2 -g0 -std=c++23 -I../common/
MAKEFLAGS += --no-print-directory
.PRECIOUS: %.o
.PRECIOUS: %.asm
OBJS = $(SRCS:.cc=.o)
ASMS = $(SRCS:.cc=.asm)
all: $(TARGET) $(ASMS)
$(TARGET): $(OBJS)
asm: $(ASMS)
%.o: %.cc
@echo CC $@
@g++ $(CXXFLAGS) -c $< -o $@
%.asm: %.o
@echo DEC $@
@objdump -d -M intel $< > $@
%.elf: %.o | %.asm
@echo CC/LD $@
@g++ $(CXXFLAGS) -o $@ $^
clean:
rm -f *.elf *.asm *.o
.PHONY: clean all asm