source: trunk/src/os2ahci/wmakefile@ 118

Last change on this file since 118 was 112, checked in by Markus Thielen, 14 years ago
  • removed RAS calls (tracing to OS/2 kernel trace buffer was unreliable)
  • added private trace ring buffer implementation
  • support read from OS2AHCI$ character device
  • contents of trace ring buffer are accesible via OS2AHCI$ character device
  • updated WATCOM makefile; WATCOM build still produces a non-working driver
  • code cleanup (unused variables etc.)
  • Property svn:executable set to *
File size: 4.9 KB
Line 
1###############################################################################
2# wmakefile - makefile for os2ahci driver using WATCOM compiler
3#
4# Copyright (c) 2010 Christian Mueller, Markus Thielen.
5# Parts copied from/inspired by the Linux AHCI driver;
6# those parts are (c) Linux AHCI/ATA maintainers
7#
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program; if not, write to the Free Software
20# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
22###############################################################################
23# Calling Syntax
24#
25# wmake -ms -f wmakefile
26#
27# NOTE: we use MS compatibility mode (-ms) so we can use a syntax similar
28# to the well known nmake syntax.
29#
30
31#
32# THE WATCOM BUILD IS BROKEN!
33#
34# It might run through but produces a non-working driver
35#
36
37###############################################################################
38# wmake directives
39.HOLD # do not prompt for deletion of created files on error; leave them alone
40
41
42
43###############################################################################
44# Environment
45
46# main path to OS/2 DDK; this needs to be set before this makefile will work
47!ifndef DDK
48DDK = i:\ddk
49!endif
50
51# main path to WATCOM installation
52!ifndef WATCOM
53WATCOM = i:\watcom
54!endif
55
56CC_INCLUDE = -I..\include \
57 -I$(DDK)\base\h \
58 -I$(DDK)\base\ibmh \
59 -I$(DDK)\base\src\dev\dasd\diskh \
60 -I$(DDK)\base\src\dev\thinkpad\dockii\apmcalls \
61 -I$(CC16)\include
62
63AS_INCLUDE = -I:$(DDK)\base\inc \
64 -I:$(DDK)\base\src\dev\dasd\diskinc
65
66LIB_DIRS = $(DDK)\base\lib\ \
67 $(DDK)\base\src\dev\dasd\devhlp\ \
68 $(DDK)\base\src\dev\thinkpad\dockii\apmcalls\ \
69
70###############################################################################
71# Tool Chain
72#
73# This makefile uses the Watcom 16bit compiler.
74# Linker and assembler are link.exe and alp.exe that ship with the OS/2 DDK
75#
76
77AS = $(DDK)\tools\alp.exe
78CC = wcc
79LD = $(DDK)\base\tools\link.exe
80BLDLEVEL = cmd.exe /c ..\..\tools\bldlvl.cmd
81BLDDATE = cmd.exe /c ..\..\tools\blddate.cmd
82MAPSYM = $(DDK)\base\tools\mapsym.exe
83
84AFLAGS = -Mb
85CFLAGS = -d3 -hc -bt=os2 -ms -zu -5 -w3 -wcd=138 -wcd=300 -ecc -zp1 -q -s -zgp -zfp -oi
86CFLAGS_DEBUG = -d3 -hc
87LFLAGS = /noe /nod /packd /a:16 /batch /map /line
88
89###############################################################################
90# Main dependencies
91
92TARGET = os2ahci.add
93
94LIBS = addcalls doscalls rmcalls apmcalls # dhcalls not needed, see local devhelp.h
95
96SRCS = init.asm math.asm libc.c os2ahci.c pci.c ahci.c ata.c atapi.c \
97 ctxhook.c trace.c ioctl.c apm.c
98
99OBJS = init.obj libc.obj os2ahci.obj pci.obj ahci.obj ata.obj atapi.obj \
100 ctxhook.obj trace.obj ioctl.obj apm.obj
101
102INCS = os2ahci.h ahci.h version.h
103
104
105all: $(TARGET)
106
107clean:
108 rm -f $(OBJS) $(TARGET) *.lst *.cod
109
110###############################################################################
111# Object/source dependencies
112
113init.obj: init.asm Makefile
114
115libc.obj: libc.c Makefile $(INCS)
116
117os2ahci.obj: os2ahci.c Makefile $(INCS) bldday.h ioctl.h
118
119pci.obj: pci.c Makefile $(INCS)
120
121ahci.obj: ahci.c Makefile $(INCS) ata.h atapi.h
122
123ata.obj: ata.c Makefile $(INCS) ata.h
124
125atapi.obj: atapi.c Makefile $(INCS) ata.h atapi.h
126
127ctxhook.obj: ctxhook.c Makefile $(INCS) ata.h atapi.h
128
129apm.obj: apm.c Makefile $(INCS)
130
131ioctl.obj: ioctl.c Makefile $(INCS) atapi.h ioctl.h
132
133trace.obj: trace.c Makefile $(INCS)
134
135os2ahci.def: version.h os2ahci.def.template
136
137###############################################################################
138# Action definitions (compile/link commands)
139
140# emacs TAGS file creation
141# NOTE: OS/2 emacs etags.exe expects an empty file named c:\dev\null...
142tags: $(SRCS) $(INCS)
143 etags.exe $(SRCS) $(INCS)
144
145bldday.h:
146 $(BLDDATE) > bldday.h
147
148.asm.obj:
149 $(AS) $(AFLAGS) $(AS_INCLUDE) $*.asm
150
151.c.obj:
152 $(CC) $(CFLAGS) $(CC_INCLUDE) $*.c
153 wdis -l $*.obj
154
155os2ahci.def:
156 $(BLDLEVEL) os2ahci.def.template os2ahci.def version.h
157
158$(TARGET): $(OBJS) os2ahci.def wmakefile
159 $(LD) $(LFLAGS) $(OBJS),$(TARGET),$*.map,$(LIB_DIRS) $(LIBS),$*.def
160 mapsym os2ahci
161
162
Note: See TracBrowser for help on using the repository browser.