separated DOS GLUT from GLX GLUT.
[mesa.git] / src / glut / dos / Makefile.DJ
1 # DOS/DJGPP Mesa Utility Toolkit
2 # Version: 1.0
3 #
4 # Copyright (C) 2005 Daniel Borca 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 # DANIEL BORCA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20 # IN 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
24 #
25 # Available options:
26 #
27 # Environment variables:
28 # CFLAGS
29 #
30 # GLIDE path to Glide3 SDK; used to resolve DXEs.
31 # default = $(TOP)/glide3
32 #
33 # Targets:
34 # all: build GLUT
35 # clean: remove object files
36 #
37
38
39
40 .PHONY: all clean
41
42 TOP = ../../..
43 GLIDE ?= $(TOP)/glide3
44 LIBDIR = $(TOP)/lib
45 GLUT_LIB = libglut.a
46 GLUT_DXE = glut.dxe
47 GLUT_IMP = libiglut.a
48
49 export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib
50
51 CC = gcc
52 CFLAGS += -I$(TOP)/include -I. -IPC_HW
53 CFLAGS += -DGLUT_IMPORT_LIB
54
55 AR = ar
56 ARFLAGS = crus
57
58 HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
59
60 ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
61 UNLINK = del $(subst /,\,$(1))
62 else
63 UNLINK = $(RM) $(1)
64 endif
65
66 CORE_SOURCES = \
67 loop.c \
68 callback.c \
69 color.c \
70 extens.c \
71 init.c \
72 menu.c \
73 mouse.c \
74 overlay.c \
75 state.c \
76 util.c \
77 window.c \
78 f8x13.c \
79 f9x15.c \
80 hel10.c \
81 hel12.c \
82 hel18.c \
83 tr10.c \
84 tr24.c \
85 mroman.c \
86 roman.c \
87 bitmap.c \
88 stroke.c \
89 teapot.c \
90 shapes.c
91
92 PC_HW_SOURCES = \
93 PC_HW/pc_hw.c \
94 PC_HW/pc_keyb.c \
95 PC_HW/pc_mouse.c \
96 PC_HW/pc_timer.c \
97 PC_HW/pc_irq.S
98
99 SOURCES = $(CORE_SOURCES) $(PC_HW_SOURCES)
100
101 OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
102
103 .c.o:
104 $(CC) -o $@ $(CFLAGS) -c $<
105 .S.o:
106 $(CC) -o $@ $(CFLAGS) -c $<
107 .s.o:
108 $(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
109
110 all: $(LIBDIR)/$(GLUT_LIB) $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP)
111
112 $(LIBDIR)/$(GLUT_LIB): $(OBJECTS)
113 $(AR) $(ARFLAGS) $@ $^
114
115 $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS)
116 ifeq ($(HAVEDXE3),)
117 $(warning Missing DXE3 package... Skipping $(GLUT_DXE))
118 else
119 -dxe3gen -o $(LIBDIR)/$(GLUT_DXE) -Y $(LIBDIR)/$(GLUT_IMP) -D "MesaGLUT DJGPP" -E _glut -P gl.dxe -U $^
120 endif
121
122 clean:
123 -$(call UNLINK,*.o)
124 -$(call UNLINK,PC_HW/*.o)
125
126 -include depend