updates from Daniel Borca
[mesa.git] / src / glut / dos / Makefile.DJ
1 # Mesa 3-D graphics library
2 # Version: 4.0
3 #
4 # Copyright (C) 1999 Brian Paul All Rights Reserved.
5 #
6 # Permission is hereby granted, free of charge, to any person obtaining a
7 # copy of this software and associated documentation files (the "Software"),
8 # to deal in the Software without restriction, including without limitation
9 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 # and/or sell copies of the Software, and to permit persons to whom the
11 # Software is furnished to do so, subject to the following conditions:
12 #
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
15 #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 # BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23 # DOS/DJGPP glut makefile v1.1 for Mesa 4.0
24 #
25 # Copyright (C) 2002 - Borca Daniel
26 # Email : dborca@yahoo.com
27 # Web : http://www.geocities.com/dborca
28
29
30 #
31 # Available options:
32 #
33 # Environment variables:
34 # CFLAGS
35 #
36 # GLIDE absolute path to Glide SDK; used with FX.
37 # default = $(TOP)/include/glide3
38 # FX=1 build for 3dfx Glide3; use it if you have the glide
39 # SDK (designed for your platform), and, of course, a
40 # 3dfx card... Note that this disables compilation of
41 # actual DMesa code, as Glide does all the stuff!
42 # default = no
43 # MARK absolute path to original GLUT.
44 # default = $(TOP)/src-glut
45 #
46 # Targets:
47 # all: build GLUT
48 # clean: remove object files
49 #
50
51
52
53 .PHONY: all clean
54
55 TOP = ..
56 GLIDE ?= $(TOP)/include/glide3
57 MARK ?= $(TOP)/src-glut
58 LIBDIR = $(TOP)/lib
59 GLUT_LIB = libglut.a
60 GLUT_DXE = glut.dxe
61 GLUT_IMP = libiglut.a
62
63 CC = gcc
64 CFLAGS += -I$(TOP)/include -I$(MARK)
65 ifdef FX
66 CFLAGS += -D__DOS__ -I$(GLIDE) -DFX -DFX_GLIDE3 -DFXMESA_USE_ARGB
67 endif
68
69 AR = ar
70 ARFLAGS = ru
71
72 ifneq ($(wildcard $(DJDIR)/lib/dxe2.ld),)
73 DXE2GEN = $(wildcard $(addsuffix /dxe2gen.exe,$(subst ;, ,$(PATH))))
74 endif
75
76 RM = del
77
78 CORE_SOURCES = \
79 bitmap.c \
80 callback.c \
81 color.c \
82 globals.c \
83 init.c \
84 menu.c \
85 models.c \
86 overlay.c \
87 state.c \
88 teapot.c \
89 window.c
90
91 PC_HW_SOURCES = \
92 PC_HW/pc_hw.c \
93 PC_HW/pc_keyb.c \
94 PC_HW/pc_mouse.c \
95 PC_HW/pc_timer.c \
96 PC_HW/pc_irq.S
97
98 MARK_SOURCES = \
99 $(MARK)/glut_8x13.c \
100 $(MARK)/glut_9x15.c \
101 $(MARK)/glut_hel10.c \
102 $(MARK)/glut_hel12.c \
103 $(MARK)/glut_hel18.c \
104 $(MARK)/glut_tr10.c \
105 $(MARK)/glut_tr24.c
106
107 SOURCES = $(CORE_SOURCES) $(PC_HW_SOURCES) $(MARK_SOURCES)
108
109 OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
110
111 .c.o:
112 $(CC) -o $@ -c $(CFLAGS) $<
113 .S.o:
114 $(CC) -o $@ -c $(CFLAGS) $<
115 .s.o:
116 $(CC) -o $@ -c $(CFLAGS) -x assembler-with-cpp $<
117
118 all: $(LIBDIR)/$(GLUT_LIB) $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP)
119
120 $(LIBDIR)/$(GLUT_LIB): $(OBJECTS)
121 $(AR) $(ARFLAGS) $(LIBDIR)/$(GLUT_LIB) $(OBJECTS)
122
123 $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS)
124 ifeq ($(DXE2GEN),)
125 $(warning Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN)
126 $(warning somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.)
127 else
128 -dxe2gen -o $(LIBDIR)/$(GLUT_DXE) -I $(LIBDIR)/$(GLUT_IMP) $(OBJECTS) -E djgpp_ -E glut -D "Mesa DJGPP GLUT" -U
129 endif
130
131 clean:
132 -$(RM) $(subst /,\,*.o)
133 -$(RM) $(subst /,\,PC_HW/*.o)
134 -$(RM) $(subst /,\,$(MARK)/*.o)
135
136 -include depend