mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-04 04:50:22 +00:00
Clean-up makefile
This commit is contained in:
parent
88adf0b29f
commit
cb25713c99
|
@ -1,13 +1,16 @@
|
|||
|
||||
# GLEW Setup:
|
||||
# Download the latest GLEW source release from https://github.com/nigels-com/glew/releases/latest
|
||||
# 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
|
||||
#
|
||||
# FreeGLUT Setup:
|
||||
# Although newer version of FreeGLUT (3.x) are available we do not use those.
|
||||
# This is because the local version has quite a few custom changes that should be moved out.
|
||||
# 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
|
||||
|
||||
FREEGLUT_SRCS := \
|
||||
$(wildcard $(PATH_INTERNAL_C)/parts/core/freeglut/*.c) \
|
||||
|
@ -23,7 +26,7 @@ $(PATH_INTERNAL_C)/parts/core/glew/%.o: $(PATH_INTERNAL_C)/parts/core/glew/%.c
|
|||
$(CC) -O3 $(CFLAGS) $(FREEGLUT_INCLUDE) -DGLEW_STATIC -Wall $< -c -o $@
|
||||
|
||||
$(PATH_INTERNAL_C)/parts/core/freeglut/%.o: $(PATH_INTERNAL_C)/parts/core/freeglut/%.c
|
||||
$(CC) -O3 $(CFLAGS) $(FREEGLUT_INCLUDE) -DFREEGLUT_STATIC -DHAVE_UNISTD_H -Wall $< -c -o $@
|
||||
$(CC) -O3 $(CFLAGS) $(FREEGLUT_INCLUDE) -DFREEGLUT_STATIC -Wall $< -c -o $@
|
||||
|
||||
$(FREEGLUT_LIB): $(FREEGLUT_OBJS)
|
||||
$(AR) rcs $@ $(FREEGLUT_OBJS)
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
-downloaded: http://freeglut.sourceforge.net/index.php#download
|
||||
-copied *.c in 'src' folder of download to src
|
||||
-copied headers in 'include' folder of download to src
|
||||
-created QB64 program to help locally build freeglut without makefiles
|
||||
note: this program is for reference purposes only, do not run it unless you fully understand it
|
||||
note: for rebuilding edits to the exisiting source, simple run the batch/script file provided
|
||||
|
||||
########################### QB64 PROGRAM TO MANAGE FREEGLUT LIBRARY ######################################
|
||||
'FreeGLUT Source Manipulation
|
||||
rel_c_path$ = "..\..\"
|
||||
c_path$ = "c:\qb64_gl_core\internal\c\" '<<<<<<<<<< ********CHANGE ME*********
|
||||
path$ = c_path$ + "parts\core\"
|
||||
SHELL "dir /b /s " + path$ + "src\*.c >glutfiles.txt"
|
||||
OPEN path$ + "rebuild_libfreeglut_a.bat" FOR OUTPUT AS #10
|
||||
OPEN path$ + "rebuild_libfreeglut_a_pause.bat" FOR OUTPUT AS #11
|
||||
OPEN "glutfiles.txt" FOR INPUT AS #1
|
||||
DO UNTIL EOF(1)
|
||||
LINE INPUT #1, f$
|
||||
IF LEN(f$) THEN
|
||||
OPEN f$ FOR BINARY AS #2
|
||||
a$ = SPACE$(LOF(2))
|
||||
GET #2, , a$
|
||||
CLOSE #2
|
||||
h$ = "#ifndef FREEGLUT_STATIC"
|
||||
IF LEFT$(a$, LEN(h$)) <> h$ THEN
|
||||
a$ = "#ifndef FREEGLUT_STATIC" + CHR$(13) + CHR$(10) + "#define FREEGLUT_STATIC" + CHR$(13) + CHR$(10) + "#endif" + CHR$(13) + CHR$(10) + a$
|
||||
END IF
|
||||
DO
|
||||
i = INSTR(a$, "#include <GL/")
|
||||
IF i THEN
|
||||
a$ = LEFT$(a$, i - 1) + "#include <" + RIGHT$(a$, LEN(a$) - i - 12)
|
||||
END IF
|
||||
i = INSTR(a$, "#include <freeglut.h>")
|
||||
IF i THEN
|
||||
MID$(a$, i) = "#include " + CHR$(34) + "freeglut.h" + CHR$(34)
|
||||
END IF
|
||||
i = INSTR(a$, "#include <freeglut_std.h>")
|
||||
IF i THEN
|
||||
MID$(a$, i) = "#include " + CHR$(34) + "freeglut_std.h" + CHR$(34)
|
||||
END IF
|
||||
LOOP UNTIL i = 0
|
||||
OPEN f$ FOR OUTPUT AS #2: CLOSE #2: OPEN f$ FOR BINARY AS #2
|
||||
PUT #2, , a$
|
||||
CLOSE #2
|
||||
'strip path from it \
|
||||
FOR x = LEN(f$) TO 1 STEP -1
|
||||
IF ASC(f$, x) = 92 THEN EXIT FOR
|
||||
NEXT
|
||||
f2$ = RIGHT$(f$, LEN(f$) - x) '.c
|
||||
f3$ = LEFT$(f2$, LEN(f2$) - 2) 'without .c
|
||||
PRINT #10, rel_c_path$ + "bin\gcc -s -O2 -c src\" + f2$ + " -o temp\" + f3$ + ".o"
|
||||
PRINT #11, rel_c_path$ + "bin\gcc -s -O2 -c src\" + f2$ + " -o temp\" + f3$ + ".o"
|
||||
PRINT #11, "pause"
|
||||
o$ = o$ + " temp\" + f3$ + ".o"
|
||||
END IF
|
||||
LOOP
|
||||
CLOSE #1
|
||||
PRINT #10, rel_c_path$ + "\bin\ar rcs libfreeglut_static.a " + o$
|
||||
PRINT #11, rel_c_path$ + "\bin\ar rcs libfreeglut_static.a " + o$
|
||||
PRINT #11, "********************* PROCESS COMPLETE **************************"
|
||||
PRINT #11, "pause"
|
||||
PRINT #11, "pause"
|
||||
PRINT #11, "pause"
|
||||
PRINT #11, "pause"
|
||||
PRINT #11, "pause"
|
||||
CLOSE
|
Loading…
Reference in a new issue