Skip to content

Commit

Permalink
Update Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
raysan5 committed Oct 15, 2024
1 parent 159c93d commit 7498908
Showing 1 changed file with 7 additions and 49 deletions.
56 changes: 7 additions & 49 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(OS),Windows_NT)
PLATFORM_OS = WINDOWS
export PATH := $(COMPILER_PATH):$(PATH)
ifndef PLATFORM_SHELL
PLATFORM_SHELL = cmd
endif
else
UNAMEOS = $(shell uname)
ifeq ($(UNAMEOS),Linux)
Expand All @@ -87,38 +84,13 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(UNAMEOS),Darwin)
PLATFORM_OS = OSX
endif
ifndef PLATFORM_SHELL
PLATFORM_SHELL = sh
endif
endif
endif
ifeq ($(PLATFORM),PLATFORM_DRM)
UNAMEOS = $(shell uname)
ifeq ($(UNAMEOS),Linux)
PLATFORM_OS = LINUX
endif
ifndef PLATFORM_SHELL
PLATFORM_SHELL = sh
endif
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
ifeq ($(OS),Windows_NT)
PLATFORM_OS = WINDOWS
ifndef PLATFORM_SHELL
PLATFORM_SHELL = cmd
endif
else
UNAMEOS = $(shell uname)
ifeq ($(UNAMEOS),Linux)
PLATFORM_OS = LINUX
endif
ifeq ($(UNAMEOS),Darwin)
PLATFORM_OS = OSX
endif
ifndef PLATFORM_SHELL
PLATFORM_SHELL = sh
endif
endif
endif

ifeq ($(PLATFORM_OS),WINDOWS)
Expand Down Expand Up @@ -367,40 +339,26 @@ $(PROJECT_NAME): $(OBJS)
%.o: %.c
$(CC) -c $< -o $@ $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM)

.PHONY: clean_shell_cmd clean_shell_sh

# Clean everything
clean: clean_shell_$(PLATFORM_SHELL)
@echo Cleaning done

clean_shell_sh:
clean:
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
del *.o *.exe /s
endif
ifeq ($(PLATFORM_OS),LINUX)
find . -type f -executable -delete
rm -fv *.o
endif
ifeq ($(PLATFORM_OS),OSX)
find . -type f -perm +ugo+x -delete
rm -f *.o
rm -f *.o external/*.o $(PROJECT_NAME)
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
find . -type f -executable -delete
rm -fv *.o
endif
ifeq ($(PLATFORM),PLATFORM_DRM)
find . -type f -executable -delete
rm -fv *.o
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
ifeq ($(PLATFORM_OS),LINUX)
rm -fv *.o $(PROJECT_NAME).data $(PROJECT_NAME).html $(PROJECT_NAME).js $(PROJECT_NAME).wasm
endif
ifeq ($(PLATFORM_OS),OSX)
rm -f *.o $(PROJECT_NAME).data $(PROJECT_NAME).html $(PROJECT_NAME).js $(PROJECT_NAME).wasm
endif
del *.o *.html *.js
endif
@echo Cleaning done

clean_shell_cmd: SHELL=cmd
clean_shell_cmd:
del *.o *.exe $(PROJECT_NAME).data $(PROJECT_NAME).html $(PROJECT_NAME).js $(PROJECT_NAME).wasm /s

0 comments on commit 7498908

Please sign in to comment.