31 lines
456 B
Makefile
31 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
|