<commit_before>CC= 	g++ -std=c++11

TARGET=	bin/basicnes

OBJECTS= \
	build/APU.o \
	build/Cart.o \
	build/Console.o \
	build/Controller.o \
	build/CPU.o \
	build/main.o \
	build/PPU.o \
	build/Graphics.o \
	build/Mapper0.o \
	build/Mapper1.o

DEPS= $(OBJECTS:.o=.d)
-include $(DEPS)

# -w, suppress warnings
# -g, debug symbols (disable -O2 beforehand)
# -Wall, enable most warnings
# -Wl,-subsystem,windows gets rid of the console window
# -mwindows or -mconsole do similar
# -O2, optimize
# -MMD -MP, generate dependency (.d) files with phony targets
CFLAGS=	-O3 -DNDEBUG

INC+= -Isrc -MMD -MP

ifeq ($(OS),Windows_NT)
	TARGET=	bin/basicnes.exe
	LFLAGS+= -lmingw32 -lSDL2main -lSDL2
	LIB+= -L lib/SDL2
	INC+= -I include/SDL2
else
	LFLAGS+= $(shell sdl2-config --libs)
	INC+= $(shell sdl2-config --cflags)
endif

.PHONY: all
all: $(TARGET)

.PHONY: debug
debug: CFLAGS = -g -Og
debug: all

$(TARGET): $(OBJECTS)
	$(CC) $^ -o $(TARGET) $(LIB) $(LFLAGS)

build/%.o: src/%.cpp
	$(CC) $(CFLAGS) $(INC) -c -o $@ $<


.PHONY: clean
clean:
	rm -r build/*
	rm $(TARGET)<commit_msg>Use -O0 instead of -Og for debug build to prevent inlining for gdb<commit_after>CC= 	g++ -std=c++11

TARGET=	bin/basicnes

OBJECTS= \
	build/APU.o \
	build/Cart.o \
	build/Console.o \
	build/Controller.o \
	build/CPU.o \
	build/main.o \
	build/PPU.o \
	build/Graphics.o \
	build/Mapper0.o \
	build/Mapper1.o

DEPS= $(OBJECTS:.o=.d)
-include $(DEPS)

# -w, suppress warnings
# -g, debug symbols (disable -O2 beforehand)
# -Wall, enable most warnings
# -Wl,-subsystem,windows gets rid of the console window
# -mwindows or -mconsole do similar
# -O2, optimize
# -MMD -MP, generate dependency (.d) files with phony targets
CFLAGS=	-O3 -DNDEBUG

INC+= -Isrc -MMD -MP

ifeq ($(OS),Windows_NT)
	TARGET=	bin/basicnes.exe
	LFLAGS+= -lmingw32 -lSDL2main -lSDL2
	LIB+= -L lib/SDL2
	INC+= -I include/SDL2
else
	LFLAGS+= $(shell sdl2-config --libs)
	INC+= $(shell sdl2-config --cflags)
endif

.PHONY: all
all: $(TARGET)

.PHONY: debug
debug: CFLAGS = -g -O0
debug: all

$(TARGET): $(OBJECTS)
	$(CC) $^ -o $(TARGET) $(LIB) $(LFLAGS)

build/%.o: src/%.cpp
	$(CC) $(CFLAGS) $(INC) -c -o $@ $<


.PHONY: clean
clean:
	rm -r build/*
	rm $(TARGET)
{'fraction_non_alphanumeric': 0.17975487970948706, 'fraction_numerical': 0.014525646845211076, 'mean_word_length': 3.198095238095238, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '577436', 'n_tokens_mistral': 974, 'n_tokens_neox': 927, 'n_words': 253}