-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
73 lines (66 loc) · 2.33 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# [HOW TO BUILD FOR DOS]
# First you need DJGPP installed as well as MinGW if you're on Windows:
# https://github.com/andrewwutw/build-djgpp/releases
#
# Once installed, run `make` in this directory
# Make will generate libice.a
#
# To build a DOS program, there are 4 static libraries needed to link against:
# libice.a - The library you just made
# libm.a - Standard math library
# libigl.a - GLIDE import library
# libgl.a - Mesa OpenGL library
#
# libigl.a and libgl.a are generated from the Mesa graphics library
# Prebuilt binaries should already exist under lib/mesa/lib
#
# Use the following command template to link and compile:
# i586-pc-msdosdjgpp-gcc <source.c> -lice -lm -ligl -lgl -o <output.exe>
#
# Example:
# i586-pc-msdosdjgpp-gcc -I. demos/triangle.c -L. -lice -lm -Llib/mesa/lib -ligl -lgl -o test.exe
#
# To run, the following files must be in the same directory as the DOS program:
# CWSDPMI.EXE
# GL.DXE
# GLIDE3X.DXE
#
# CWSDPMI.EXE should already be included but it can also be obtained from:
# https://sandmann.dotster.com/cwsdpmi/
#
# Only GL.DXE is required if you are using software rendering
# GLIDE3X.DXE is required if you are using hardware rendering
#
# GL.DXE can be found under lib/mesa/lib
#
# GLIDE3X.DXE can be obtained from:
# https://github.com/basecq/q2dos/tree/master/dos/3rdparty/lib_dxe/voodoo
# Make sure to choose the correct DXE driver for the Voodoo card you're using
# [HOW TO BUILD FOR SDL2]
# For Windows you will need MinGW installed
#
# Run `make CC=gcc PLATFORM=sdl` in this directory
# Make will generate libice.a
#
# To build a SDL2 program, these are the libraries you need to link against:
# libice.a - The library you just made
# libm.a - Standard math library
# libmingw32.a - MinGW library (only on Windows)
# libSDL2main.a - SDL2 main library
# libSDL2.a - SDL2 library
# libGL.a - OpenGL library (libopengl32.a on Windows)
#
# Use the following command template to link and compile:
# gcc <source.c> -lice -lm -lSDL2main -lSDL2 -lGL -o <output.exe>
#
# Windows example:
# gcc -I. demos/triangle.c -L. -lice -lm -lmingw32 -lSDL2main -lSDL2 -lopengl32 -o test.exe
CC = i586-pc-msdosdjgpp-gcc
CFLAGS = -std=gnu99 -Wall -Wextra -Wno-attributes -s -O2
PLATFORM = dos
all: libice.a
libice.a:
$(CC) $(CFLAGS) -I. -c platform/$(PLATFORM)/*.c
ar -rcs libice.a *.o
clean:
$(RM) *.a *.o