1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-08-06 17:30:24 +00:00
QB64-PE/internal/c/parts/core/build.mk

40 lines
1.6 KiB
Makefile
Raw Normal View History

2022-04-29 04:40:57 +00:00
# GLEW Setup:
2024-01-22 02:11:02 +00:00
# Download the latest release from https://github.com/nigels-com/glew/releases/latest
# Only copy glew.c in src/ to internal/c/parts/core/glew
# Copy the include directory to internal/c/parts/core/glew
# Compile the source using -DGLEW_STATIC
2024-01-21 22:19:46 +00:00
#
# FreeGLUT Setup:
2024-01-22 02:11:02 +00:00
# Although newer version of FreeGLUT (3.x) are available we do not use those (yet).
# This is because the local version has quite a few custom changes that should be moved out first.
# Download the latest 2.x release from https://freeglut.sourceforge.net/
# Copy all .c files from the src directory into internal/c/parts/core/freeglut (after making QB64-PE specific changes)
# Copy the include directory to internal/c/parts/core/freeglut
# Compile the source using -DFREEGLUT_STATIC
FREEGLUT_SRCS := $(wildcard $(PATH_INTERNAL_C)/parts/core/freeglut/*.c)
GLEW_SRCS := $(PATH_INTERNAL_C)/parts/core/glew/glew.c
2024-01-21 22:19:46 +00:00
FREEGLUT_INCLUDE := -I$(PATH_INTERNAL_C)/parts/core/freeglut/include -I$(PATH_INTERNAL_C)/parts/core/glew/include
2022-04-29 04:40:57 +00:00
FREEGLUT_OBJS := $(FREEGLUT_SRCS:.c=.o)
GLEW_OBJS := $(GLEW_SRCS:.c=.o)
2022-04-29 04:40:57 +00:00
2024-01-21 22:19:46 +00:00
FREEGLUT_LIB := $(PATH_INTERNAL_C)/parts/core/freeglut.a
2022-04-29 04:40:57 +00:00
$(PATH_INTERNAL_C)/parts/core/glew/%.o: $(PATH_INTERNAL_C)/parts/core/glew/%.c
$(CC) -O1 $(CFLAGS) $(FREEGLUT_INCLUDE) -DGLEW_STATIC -Wall $< -c -o $@
2024-01-21 22:19:46 +00:00
$(PATH_INTERNAL_C)/parts/core/freeglut/%.o: $(PATH_INTERNAL_C)/parts/core/freeglut/%.c
2024-01-29 21:31:26 +00:00
$(CC) -O3 $(CFLAGS) $(FREEGLUT_INCLUDE) -DFREEGLUT_STATIC -DHAVE_UNISTD_H -DHAVE_FCNTL_H -Wall $< -c -o $@
2022-04-29 04:40:57 +00:00
$(FREEGLUT_LIB): $(FREEGLUT_OBJS)
$(AR) rcs $@ $(FREEGLUT_OBJS)
QB_CORE_LIB := $(FREEGLUT_LIB)
CXXFLAGS += $(FREEGLUT_INCLUDE)
CLEAN_LIST += $(FREEGLUT_LIB) $(FREEGLUT_OBJS) $(GLEW_OBJS)