-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
61 lines (51 loc) · 1.73 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
# [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 compile a demo program:
# i586-pc-msdosdjgpp-gcc -I. demos/c99/triangle.c -L. -lice -lm -Llib/tinygl/lib -lTinyGL -o test.exe
#
# To compile with 3dfx Voodoo support:
# Edit platform/dos/video.c and change vesa.h to mesa.h
# Run make again
# Swap '-Llib/tinygl/lib -lTinyGL' with '-Llib/mesa/lib -ligl -lgl'
# To run, the following files must be in the same directory as the DOS program:
# CWSDPMI.EXE
# GL.DXE (Only if using 3dfx Voodoo)
# GLIDE3X.DXE (Only if using 3dfx Voodoo)
#
# CWSDPMI.EXE should already be included but it can also be obtained from:
# https://sandmann.dotster.com/cwsdpmi/
#
# 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]
# On Windows you will need MinGW installed
#
# Run `make CC=gcc PLATFORM=sdl` in this directory
# Make will generate libice.a
#
# 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/c99/triangle.c -L. -lice -lm -lmingw32 -lSDL2main -lSDL2 -lopengl32 -o test.exe
CC = i586-pc-msdosdjgpp-gcc
AR = ar
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
glad.o:
$(CC) $(CFLAGS) -Ilib/glad -c lib/glad/glad.c
clean:
$(RM) *.a *.o