2023-06-30 23:30:39 -04:00
|
|
|
C_SOURCES:=$(wildcard src/*.c)
|
2021-11-14 06:07:31 -05:00
|
|
|
C_OBJECTS:=$(patsubst %.c, %.o, $(C_SOURCES))
|
|
|
|
OBJECTS:=$(C_OBJECTS)
|
2019-04-05 14:52:01 -04:00
|
|
|
ENAME=ClassiCube
|
|
|
|
DEL=rm
|
2021-11-17 02:50:30 -05:00
|
|
|
CFLAGS=-g -pipe -fno-math-errno
|
2019-04-07 08:28:03 -04:00
|
|
|
LDFLAGS=-g -rdynamic
|
2018-10-14 02:31:13 -04:00
|
|
|
|
2019-04-06 03:44:53 -04:00
|
|
|
ifndef $(PLAT)
|
2019-04-05 15:44:56 -04:00
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
PLAT=mingw
|
|
|
|
else
|
2019-04-06 09:16:52 -04:00
|
|
|
PLAT=$(shell uname -s | tr '[:upper:]' '[:lower:]')
|
2019-04-05 15:44:56 -04:00
|
|
|
endif
|
2021-11-14 02:59:39 -05:00
|
|
|
|
|
|
|
ifeq ($(PLAT),darwin)
|
|
|
|
ifeq ($(shell uname -m), x86_64)
|
|
|
|
PLAT=mac_x64
|
|
|
|
else
|
|
|
|
PLAT=mac_x32
|
|
|
|
endif
|
|
|
|
endif
|
2019-04-05 14:52:01 -04:00
|
|
|
endif
|
2018-10-14 02:31:13 -04:00
|
|
|
|
2019-04-07 08:28:03 -04:00
|
|
|
ifeq ($(PLAT),web)
|
|
|
|
CC=emcc
|
|
|
|
OEXT=.html
|
2019-11-15 07:15:03 -05:00
|
|
|
CFLAGS=-g
|
2021-06-07 21:48:45 -04:00
|
|
|
LDFLAGS=-s WASM=1 -s NO_EXIT_RUNTIME=1 --preload-file texpacks/default.zip@texpacks/default.zip
|
2019-04-07 08:28:03 -04:00
|
|
|
endif
|
2019-04-05 14:52:01 -04:00
|
|
|
|
2019-04-07 08:28:03 -04:00
|
|
|
ifeq ($(PLAT),mingw)
|
2020-05-31 10:22:02 -04:00
|
|
|
CC=gcc
|
2019-04-07 08:28:03 -04:00
|
|
|
OEXT=.exe
|
2020-03-08 17:53:06 -04:00
|
|
|
CFLAGS=-g -pipe -DUNICODE -fno-math-errno
|
2019-04-07 08:28:03 -04:00
|
|
|
LDFLAGS=-g
|
2022-08-21 06:58:12 -04:00
|
|
|
LIBS=-mwindows -lwinmm -limagehlp
|
2019-04-07 08:28:03 -04:00
|
|
|
endif
|
2019-04-05 14:52:01 -04:00
|
|
|
|
2019-04-07 08:28:03 -04:00
|
|
|
ifeq ($(PLAT),linux)
|
2020-05-26 08:06:03 -04:00
|
|
|
LIBS=-lX11 -lXi -lpthread -lGL -lm -ldl
|
2019-04-07 08:28:03 -04:00
|
|
|
endif
|
2019-04-05 15:44:56 -04:00
|
|
|
|
2019-04-07 08:28:03 -04:00
|
|
|
ifeq ($(PLAT),sunos)
|
2021-09-11 18:09:00 -04:00
|
|
|
CFLAGS=-g -pipe -fno-math-errno
|
2020-05-26 08:06:03 -04:00
|
|
|
LIBS=-lm -lsocket -lX11 -lXi -lGL
|
2019-04-07 08:28:03 -04:00
|
|
|
endif
|
2019-04-06 03:44:53 -04:00
|
|
|
|
2021-11-14 02:59:39 -05:00
|
|
|
ifeq ($(PLAT),mac_x32)
|
|
|
|
CFLAGS=-g -m32 -pipe -fno-math-errno
|
2021-11-17 02:50:30 -05:00
|
|
|
LIBS=
|
2021-06-04 05:35:43 -04:00
|
|
|
LDFLAGS=-rdynamic -framework Carbon -framework AGL -framework OpenGL -framework IOKit
|
2019-04-07 08:28:03 -04:00
|
|
|
endif
|
2019-04-06 03:44:53 -04:00
|
|
|
|
2021-11-14 02:59:39 -05:00
|
|
|
ifeq ($(PLAT),mac_x64)
|
2023-07-01 08:14:27 -04:00
|
|
|
OBJECTS+=src/interop_cocoa.o
|
2021-11-14 02:59:39 -05:00
|
|
|
CFLAGS=-g -m64 -pipe -fno-math-errno
|
|
|
|
LIBS=
|
|
|
|
LDFLAGS=-rdynamic -framework Cocoa -framework OpenGL -framework IOKit -lobjc
|
|
|
|
endif
|
|
|
|
|
2019-04-07 08:28:03 -04:00
|
|
|
ifeq ($(PLAT),freebsd)
|
2021-08-14 09:22:12 -04:00
|
|
|
CFLAGS=-g -pipe -I /usr/local/include -fno-math-errno
|
|
|
|
LDFLAGS=-L /usr/local/lib -rdynamic
|
2020-05-26 08:06:03 -04:00
|
|
|
LIBS=-lexecinfo -lGL -lX11 -lXi -lm -lpthread
|
2019-04-07 08:28:03 -04:00
|
|
|
endif
|
2019-04-06 03:44:53 -04:00
|
|
|
|
2019-04-07 08:28:03 -04:00
|
|
|
ifeq ($(PLAT),openbsd)
|
2021-08-14 09:22:12 -04:00
|
|
|
CFLAGS=-g -pipe -I /usr/X11R6/include -I /usr/local/include -fno-math-errno
|
|
|
|
LDFLAGS=-L /usr/X11R6/lib -L /usr/local/lib -rdynamic
|
2020-05-28 09:57:00 -04:00
|
|
|
LIBS=-lexecinfo -lGL -lX11 -lXi -lm -lpthread
|
2019-04-07 08:28:03 -04:00
|
|
|
endif
|
2019-04-06 03:44:53 -04:00
|
|
|
|
2019-04-07 08:28:03 -04:00
|
|
|
ifeq ($(PLAT),netbsd)
|
2021-08-14 09:22:12 -04:00
|
|
|
CFLAGS=-g -pipe -I /usr/X11R7/include -I /usr/pkg/include -fno-math-errno
|
|
|
|
LDFLAGS=-L /usr/X11R7/lib -L /usr/pkg/lib -rdynamic
|
2020-05-31 10:22:02 -04:00
|
|
|
LIBS=-lexecinfo -lGL -lX11 -lXi -lpthread
|
2019-04-07 08:28:03 -04:00
|
|
|
endif
|
2019-04-05 15:44:56 -04:00
|
|
|
|
2020-05-05 06:03:35 -04:00
|
|
|
ifeq ($(PLAT),dragonfly)
|
2021-08-14 09:22:12 -04:00
|
|
|
CFLAGS=-g -pipe -I /usr/local/include -fno-math-errno
|
|
|
|
LDFLAGS=-L /usr/local/lib -rdynamic
|
2020-05-26 08:06:03 -04:00
|
|
|
LIBS=-lexecinfo -lGL -lX11 -lXi -lm -lpthread
|
2020-05-05 06:03:35 -04:00
|
|
|
endif
|
|
|
|
|
2019-11-11 02:23:50 -05:00
|
|
|
ifeq ($(PLAT),haiku)
|
2023-07-01 08:14:27 -04:00
|
|
|
OBJECTS+=src/interop_BeOS.o
|
2020-03-08 17:53:06 -04:00
|
|
|
CFLAGS=-g -pipe -fno-math-errno
|
2019-11-11 02:23:50 -05:00
|
|
|
LDFLAGS=-g
|
2023-07-16 02:56:11 -04:00
|
|
|
LIBS=-lm -lGL -lnetwork -lstdc++ -lbe -lgame -ltracker
|
2019-11-11 02:23:50 -05:00
|
|
|
endif
|
|
|
|
|
2023-06-29 05:45:27 -04:00
|
|
|
ifeq ($(PLAT),beos)
|
2023-07-01 08:14:27 -04:00
|
|
|
OBJECTS+=src/interop_BeOS.o
|
2023-06-29 05:45:27 -04:00
|
|
|
CFLAGS=-g -pipe
|
|
|
|
LDFLAGS=-g
|
2023-07-01 22:14:21 -04:00
|
|
|
LIBS=-lGL -lnetwork -lstdc++ -lbe -lgame -ltracker
|
2023-06-29 05:45:27 -04:00
|
|
|
endif
|
|
|
|
|
2022-10-18 06:27:16 -04:00
|
|
|
ifeq ($(PLAT),serenityos)
|
|
|
|
LIBS=-lgl -lSDL2
|
|
|
|
endif
|
|
|
|
|
2023-03-23 07:21:46 -04:00
|
|
|
ifeq ($(PLAT),irix)
|
|
|
|
CC=gcc
|
|
|
|
LIBS=-lGL -lX11 -lXi -lm -lpthread -ldl
|
|
|
|
endif
|
|
|
|
|
2022-12-04 00:27:46 -05:00
|
|
|
ifeq ($(PLAT),psp)
|
|
|
|
CC=psp-gcc
|
2023-07-16 02:56:11 -04:00
|
|
|
CFLAGS=-g -pipe -fno-math-errno -I ${PSPDEV}/psp/sdk/include
|
2023-06-29 09:22:45 -04:00
|
|
|
LIBS=-lm -lpspgum -lpspgu -lpspge -lpspdisplay -lpspctrl
|
2023-07-16 02:56:11 -04:00
|
|
|
LDFLAGS=-g -L ${PSPDEV}/psp/sdk/lib
|
2022-12-04 00:27:46 -05:00
|
|
|
endif
|
|
|
|
|
2019-04-05 15:44:56 -04:00
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
DEL=del
|
|
|
|
endif
|
|
|
|
|
2019-04-05 14:52:01 -04:00
|
|
|
default: $(PLAT)
|
|
|
|
|
|
|
|
web:
|
2022-10-20 04:15:35 -04:00
|
|
|
$(MAKE) $(ENAME) PLAT=web
|
2019-04-05 14:52:01 -04:00
|
|
|
linux:
|
2022-10-20 04:15:35 -04:00
|
|
|
$(MAKE) $(ENAME) PLAT=linux
|
2019-04-05 14:52:01 -04:00
|
|
|
mingw:
|
2022-10-20 04:15:35 -04:00
|
|
|
$(MAKE) $(ENAME) PLAT=mingw
|
2019-08-15 09:18:32 -04:00
|
|
|
sunos:
|
2022-10-20 04:15:35 -04:00
|
|
|
$(MAKE) $(ENAME) PLAT=sunos
|
2021-11-14 02:59:39 -05:00
|
|
|
mac_x32:
|
2022-10-20 04:15:35 -04:00
|
|
|
$(MAKE) $(ENAME) PLAT=mac_x32
|
2021-11-14 02:59:39 -05:00
|
|
|
mac_x64:
|
2022-10-20 04:15:35 -04:00
|
|
|
$(MAKE) $(ENAME) PLAT=mac_x64
|
2019-04-06 03:44:53 -04:00
|
|
|
freebsd:
|
2022-10-20 04:15:35 -04:00
|
|
|
$(MAKE) $(ENAME) PLAT=freebsd
|
2019-04-06 03:44:53 -04:00
|
|
|
openbsd:
|
2022-10-20 04:15:35 -04:00
|
|
|
$(MAKE) $(ENAME) PLAT=openbsd
|
2019-04-06 03:44:53 -04:00
|
|
|
netbsd:
|
2022-10-20 04:15:35 -04:00
|
|
|
$(MAKE) $(ENAME) PLAT=netbsd
|
2020-05-05 06:03:35 -04:00
|
|
|
dragonfly:
|
2022-10-20 04:15:35 -04:00
|
|
|
$(MAKE) $(ENAME) PLAT=dragonfly
|
2019-11-11 04:19:40 -05:00
|
|
|
haiku:
|
2022-10-20 04:15:35 -04:00
|
|
|
$(MAKE) $(ENAME) PLAT=haiku
|
2023-06-29 05:45:27 -04:00
|
|
|
beos:
|
|
|
|
$(MAKE) $(ENAME) PLAT=beos
|
2022-10-18 06:27:16 -04:00
|
|
|
serenityos:
|
2022-10-20 04:15:35 -04:00
|
|
|
$(MAKE) $(ENAME) PLAT=serenityos
|
2023-03-23 07:21:46 -04:00
|
|
|
irix:
|
|
|
|
$(MAKE) $(ENAME) PLAT=irix
|
2022-12-04 00:27:46 -05:00
|
|
|
psp:
|
2023-07-16 02:56:11 -04:00
|
|
|
$(MAKE) ClassiCube-psp.elf PLAT=psp
|
2023-04-20 07:52:49 -04:00
|
|
|
3ds:
|
2023-06-30 23:30:39 -04:00
|
|
|
$(MAKE) -f src/Makefile_3DS PLAT=3ds
|
2023-06-03 02:55:46 -04:00
|
|
|
wii:
|
2023-06-30 23:30:39 -04:00
|
|
|
$(MAKE) -f src/Makefile_wii PLAT=wii
|
2023-06-03 02:55:46 -04:00
|
|
|
gamecube:
|
2023-07-26 07:42:03 -04:00
|
|
|
$(MAKE) -f src/Makefile_gamecube PLAT=gamecube
|
2023-08-08 05:19:21 -04:00
|
|
|
xbox:
|
|
|
|
$(MAKE) -f src/Makefile_xbox PLAT=xbox
|
|
|
|
vita:
|
|
|
|
$(MAKE) -f src/Makefile_vita PLAT=vita
|
2023-04-20 07:52:49 -04:00
|
|
|
|
2018-10-14 02:31:13 -04:00
|
|
|
clean:
|
2019-04-05 14:52:01 -04:00
|
|
|
$(DEL) $(OBJECTS)
|
|
|
|
|
|
|
|
$(ENAME): $(OBJECTS)
|
|
|
|
$(CC) $(LDFLAGS) -o $@$(OEXT) $(OBJECTS) $(LIBS)
|
|
|
|
|
2021-11-14 06:07:31 -05:00
|
|
|
$(C_OBJECTS): %.o : %.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2023-06-30 23:30:39 -04:00
|
|
|
src/interop_cocoa.o: src/interop_cocoa.m
|
2019-11-13 02:47:45 -05:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
2022-11-10 05:14:40 -05:00
|
|
|
|
2023-07-01 08:14:27 -04:00
|
|
|
src/interop_BeOS.o: src/interop_BeOS.cpp
|
2022-11-10 05:14:40 -05:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
2023-02-03 22:15:12 -05:00
|
|
|
|
|
|
|
# PSP requires fixups
|
2023-07-16 02:56:11 -04:00
|
|
|
ClassiCube-psp.elf : $(ENAME)
|
|
|
|
cp $(ENAME) ClassiCube-psp.elf
|
|
|
|
psp-fixup-imports ClassiCube-psp.elf
|