CFLAGS = -O3 -march=native -g -Wall -Wextra -Werror -Wpedantic -Wno-error=unused-parameter -Wno-error=unused-variable CFLAGS += $(shell pkg-config --cflags sdl2) CFLAGS += $(shell pkg-config --cflags freetype2) LDFLAGS = $(shell pkg-config --libs sdl2) LDFLAGS += $(shell pkg-config --libs freetype2) TARGET = CC = $(TARGET)gcc AS = $(TARGET)as AS = $(TARGET)ar LD = $(TARGET)ld OBJCOPY = $(TARGET)objcopy OBJDUMP = $(TARGET)objdump OBJS = fake6502.o main.o instruction.o mneumonic.o present.o text.o cpu.o HEADERS = $(wildcard *.h) all: main %.o: %.c $(HEADERS) Makefile $(CC) $(ARCH) $(CFLAGS) -c $< -o $@ main: $(OBJS) $(CC) $(ARCH) $(LDFLAGS) $^ -o $@ clean: rm -f *.o *.elf *.bin *.out *.imem *.hex .SUFFIXES: .INTERMEDIATE: .PHONY: all clean %.dump