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