diff --git a/Makefile b/Makefile index 126906b..12d15ba 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,28 @@ -# all: -# g++ ./src/main.cpp ./src/emulator/emulator.cpp -o Emulator +# Detecting OS + +ifeq ($(OS), Windows_NT) + DETECTED_OS := Windows +else + DETECTED_OS := $(shell uname) +endif + SRCS := $(shell find src -name '*.cpp') +CFLAGS := -Wall -Wextra + +ifeq ($(DETECTED_OS), Windows) + LDFLAGS := -lraylib -lgdi32 -lwinmm + RM := del /Q + +else ifeq ($(DETECTED_OS), Linux) + LDFLAGS := -lraylib + RM := rm -rf +endif + CFLAGS := $(foreach src,$(SRCS),-c $(src)) # Define o alvo padrĂ£o all: - g++ $(SRCS) -g -o Emulator -lraylib -lgdi32 -lwinmm + g++ $(SRCS) $(CFLAGS) -g -o Emulator $(LDFLAGS) clean: - rm Emulator \ No newline at end of file + $(RM) Emulator