DOS 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.3 for Mesa
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 # MKGLUT absolute path to original GLUT.
37 # default = $(TOP)/src-glut
38 #
39 # Targets:
40 # all: build GLUT
41 # clean: remove object files
42 #
43
44
45
46 .PHONY: all clean
47
48 TOP = ..
49 GLIDE ?= $(TOP)/include/glide3
50 MKGLUT ?= $(TOP)/src-glut
51 LIBDIR = $(TOP)/lib
52 GLUT_LIB = libglut.a
53 GLUT_DXE = glut.dxe
54 GLUT_IMP = libiglut.a
55
56 CC = gcc
57 CFLAGS += -I- -I$(TOP)/include -I. -I$(MKGLUT) -IPC_HW
58
59 AR = ar
60 ARFLAGS = rus
61
62 HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
63
64 ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
65 UNLINK = del $(subst /,\,$(1))
66 else
67 UNLINK = $(RM) $(1)
68 endif
69
70 CORE_SOURCES = \
71 callback.c \
72 color.c \
73 extens.c \
74 init.c \
75 menu.c \
76 mouse.c \
77 overlay.c \
78 state.c \
79 window.c
80
81 PC_HW_SOURCES = \
82 PC_HW/pc_hw.c \
83 PC_HW/pc_keyb.c \
84 PC_HW/pc_mouse.c \
85 PC_HW/pc_timer.c \
86 PC_HW/pc_irq.S
87
88 MKGLUT_SOURCES = \
89 $(MKGLUT)/glut_bitmap.c \
90 $(MKGLUT)/glut_bwidth.c \
91 $(MKGLUT)/glut_stroke.c \
92 $(MKGLUT)/glut_swidth.c \
93 $(MKGLUT)/glut_shapes.c \
94 $(MKGLUT)/glut_teapot.c \
95 $(MKGLUT)/glut_8x13.c \
96 $(MKGLUT)/glut_9x15.c \
97 $(MKGLUT)/glut_hel10.c \
98 $(MKGLUT)/glut_hel12.c \
99 $(MKGLUT)/glut_hel18.c \
100 $(MKGLUT)/glut_tr10.c \
101 $(MKGLUT)/glut_tr24.c \
102 $(MKGLUT)/glut_roman.c \
103 $(MKGLUT)/glut_mroman.c \
104 $(MKGLUT)/glut_util.c
105
106 SOURCES = $(CORE_SOURCES) $(PC_HW_SOURCES) $(MKGLUT_SOURCES)
107
108 OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
109
110 .c.o:
111 $(CC) -o $@ $(CFLAGS) -c $<
112 .S.o:
113 $(CC) -o $@ $(CFLAGS) -c $<
114 .s.o:
115 $(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
116
117 all: $(LIBDIR)/$(GLUT_LIB) $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP)
118
119 $(LIBDIR)/$(GLUT_LIB): $(OBJECTS)
120 $(AR) $(ARFLAGS) $(LIBDIR)/$(GLUT_LIB) $(OBJECTS)
121
122 $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS)
123 ifeq ($(HAVEDXE3),)
124 $(warning Missing DXE3 package... Skipping $(GLUT_DXE))
125 else
126 -dxe3gen -o $(LIBDIR)/$(GLUT_DXE) -I $(LIBDIR)/$(GLUT_IMP) -D "MesaGLUT DJGPP" -E _glut -P gl.dxe -P glu.dxe -U $(OBJECTS)
127 endif
128
129 clean:
130 -$(call UNLINK,*.o)
131 -$(call UNLINK,PC_HW/*.o)
132 -$(call UNLINK,$(MKGLUT)/*.o)
133
134 -include depend