mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-22 09:01:57 -05:00
Makefile: Add 'make terminal' case, and fix 'make clean' not working under msys environment
This commit is contained in:
parent
c9b1c04924
commit
db7700fb4b
1 changed files with 17 additions and 7 deletions
24
Makefile
24
Makefile
|
@ -5,10 +5,18 @@ C_OBJECTS := $(patsubst $(SOURCE_DIR)/%.c, $(BUILD_DIR)/%.o, $(C_SOURCES))
|
||||||
|
|
||||||
OBJECTS := $(C_OBJECTS)
|
OBJECTS := $(C_OBJECTS)
|
||||||
ENAME = ClassiCube
|
ENAME = ClassiCube
|
||||||
DEL = rm -f
|
|
||||||
CFLAGS = -g -pipe -fno-math-errno
|
CFLAGS = -g -pipe -fno-math-errno
|
||||||
LDFLAGS = -g -rdynamic
|
LDFLAGS = -g -rdynamic
|
||||||
|
|
||||||
|
ifndef RM
|
||||||
|
# No prefined RM variable, try to guess OS default
|
||||||
|
ifeq ($(OS),Windows_NT)
|
||||||
|
RM = del
|
||||||
|
else
|
||||||
|
RM = rm -f
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# Enables dependency tracking (https://make.mad-scientist.net/papers/advanced-auto-dependency-generation/)
|
# Enables dependency tracking (https://make.mad-scientist.net/papers/advanced-auto-dependency-generation/)
|
||||||
# This ensures that changing a .h file automatically results in the .c files using it being auto recompiled when next running make
|
# This ensures that changing a .h file automatically results in the .c files using it being auto recompiled when next running make
|
||||||
# On older systems the required GCC options may not be supported - in which case just change TRACK_DEPENDENCIES to 0
|
# On older systems the required GCC options may not be supported - in which case just change TRACK_DEPENDENCIES to 0
|
||||||
|
@ -102,11 +110,6 @@ ifeq ($(PLAT),irix)
|
||||||
LIBS = -lGL -lX11 -lXi -lpthread -ldl
|
LIBS = -lGL -lX11 -lXi -lpthread -ldl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(OS),Windows_NT)
|
|
||||||
DEL = del
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef SDL2
|
ifdef SDL2
|
||||||
CFLAGS += -DCC_WIN_BACKEND=CC_WIN_BACKEND_SDL2
|
CFLAGS += -DCC_WIN_BACKEND=CC_WIN_BACKEND_SDL2
|
||||||
LIBS += -lSDL2
|
LIBS += -lSDL2
|
||||||
|
@ -115,6 +118,9 @@ ifdef SDL3
|
||||||
CFLAGS += -DCC_WIN_BACKEND=CC_WIN_BACKEND_SDL3
|
CFLAGS += -DCC_WIN_BACKEND=CC_WIN_BACKEND_SDL3
|
||||||
LIBS += -lSDL3
|
LIBS += -lSDL3
|
||||||
endif
|
endif
|
||||||
|
ifdef TERMINAL
|
||||||
|
CFLAGS += -DCC_WIN_BACKEND=CC_WIN_BACKEND_TERMINAL -DCC_GFX_BACKEND=CC_GFX_BACKEND_SOFTGPU
|
||||||
|
endif
|
||||||
|
|
||||||
default: $(PLAT)
|
default: $(PLAT)
|
||||||
|
|
||||||
|
@ -144,10 +150,14 @@ serenityos:
|
||||||
$(MAKE) $(ENAME) PLAT=serenityos
|
$(MAKE) $(ENAME) PLAT=serenityos
|
||||||
irix:
|
irix:
|
||||||
$(MAKE) $(ENAME) PLAT=irix
|
$(MAKE) $(ENAME) PLAT=irix
|
||||||
|
|
||||||
|
# Default overrides
|
||||||
sdl2:
|
sdl2:
|
||||||
$(MAKE) $(ENAME) SDL2=1
|
$(MAKE) $(ENAME) SDL2=1
|
||||||
sdl3:
|
sdl3:
|
||||||
$(MAKE) $(ENAME) SDL3=1
|
$(MAKE) $(ENAME) SDL3=1
|
||||||
|
terminal:
|
||||||
|
$(MAKE) $(ENAME) TERMINAL=1
|
||||||
|
|
||||||
# Some builds require more complex handling, so are moved to
|
# Some builds require more complex handling, so are moved to
|
||||||
# separate makefiles to avoid having one giant messy makefile
|
# separate makefiles to avoid having one giant messy makefile
|
||||||
|
@ -192,7 +202,7 @@ macclassic_ppc:
|
||||||
$(MAKE) -f misc/macclassic/Makefile_ppc
|
$(MAKE) -f misc/macclassic/Makefile_ppc
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(DEL) $(OBJECTS)
|
$(RM) $(OBJECTS)
|
||||||
|
|
||||||
|
|
||||||
$(ENAME): $(BUILD_DIR) $(OBJECTS)
|
$(ENAME): $(BUILD_DIR) $(OBJECTS)
|
||||||
|
|
Loading…
Reference in a new issue