Skip to content

Commit

Permalink
Update Makefile
Browse files Browse the repository at this point in the history
making it work with linux and windows
  • Loading branch information
710lucas authored Aug 4, 2024
1 parent 5774486 commit cfc5c93
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
$(RM) Emulator

0 comments on commit cfc5c93

Please sign in to comment.