source: trunk/src/os2ahci/wmakefile@ 14

Last change on this file since 14 was 14, checked in by markus, 15 years ago

merged last NCQ related changes with Watcom related changes

  • Property svn:executable set to *
File size: 4.4 KB
Line 
1###############################################################################
2#
3# wmakefile - Watcom makefile for os2ahci driver
4#
5# NOTE: This is a wmake file! See here:
6# http://www.openwatcom.org/index.php/Using_wmake
7#
8
9#
10# Copyright (c) 2010 Markus Thielen, Christian Mueller.
11# Parts copied from/inspired by the Linux AHCI driver;
12# those parts are (c) Linux AHCI/ATA maintainers
13#
14# This program is free software; you can redistribute it and/or modify
15# it under the terms of the GNU General Public License as published by
16# the Free Software Foundation; either version 2 of the License, or
17# (at your option) any later version.
18#
19# This program is distributed in the hope that it will be useful,
20# but WITHOUT ANY WARRANTY; without even the implied warranty of
21# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22# GNU General Public License for more details.
23#
24# You should have received a copy of the GNU General Public License
25# along with this program; if not, write to the Free Software
26# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27
28###############################################################################
29# wmake options
30
31# disable prompt to delete out of date files on compile errors
32.ERASE
33
34
35###############################################################################
36# Tool Chain
37
38AS = wasm # Watcom assembler
39CC = wcc # Watcom 16bit compiler
40LD = wlink # Watcom linker
41
42
43###############################################################################
44# Environment
45#
46# we need the following set before this makefile is called:
47#
48# WATCOM - to the base WATCOM installation directory
49# DDK - to the base dir of the OS/2 DDK to use
50# PS - the path separator (/ or \)
51#
52
53DDK = $(%DDK)
54WATCOM = $(%WATCOM)
55!ifndef %PS
56PS = \
57!else
58PS = $(%PS)
59!endif
60
61CC_INCLUDE = -I$(DDK)$(PS)BASE$(PS)H &
62 -I$(DDK)$(PS)BASE$(PS)IBMH &
63 -I$(DDK)$(PS)BASE$(PS)SRC$(PS)DEV$(PS)DASD$(PS)DISKH &
64 -I$(WATCOM)$(PS)h &
65
66AS_INCLUDE = -I$(DDK)$(PS)BASE$(PS)INC &
67 -I$(DDK)$(PS)BASE$(PS)SRC$(PS)DEV$(PS)DASD$(PS)DISKINC
68
69# the linker wants this on one line, no spaces...
70LIB_DIRS = $(DDK)$(PS)BASE$(PS)LIB$;$(DDK)$(PS)BASE$(PS)SRC$(PS)DEV$(PS)DASD$(PS)DEVHLP;$(WATCOM)$(PS)LIB
71
72
73###############################################################################
74# Main dependencies
75
76TARGET = os2ahci.add
77
78LIBS = os2,addcalls,dhcalls,doscalls,rmcalls
79
80SRCS = init.asm libc.c os2ahci.c pci.c ahci.c ata.c atapi.c ctxhook.c
81
82OBJS = init.obj libc.obj os2ahci.obj pci.obj ahci.obj ata.obj atapi.obj&
83 ctxhook.obj
84
85# the Watcom linker needs commas between object files
86LDOBJS = init.obj,libc.obj,os2ahci.obj,pci.obj,ahci.obj,ata.obj,atapi.obj,&
87 ctxhook.obj
88
89INCS = os2ahci.h ahci.h
90
91
92all: $(TARGET)
93
94clean:
95 rm -f $(OBJS) $(TARGET)
96
97
98###############################################################################
99# compiler/linker flags
100
101AFLAGS = -2 -bt=os2 -w3 -zq -ms -zcm
102CFLAGS = -bt=os2 -ms -s -zdp -zff -zgf -zu -zl -2 -w2 -wcd=138 -zp=1 -q
103CFLAGS_DEBUG = -d3 -hc
104LFLAGS = name $(TARGET) sys os2 dll initglobal option map option quiet &
105 option nodefaultlibs libpath $(LIB_DIRS) file $(LDOBJS) &
106 library $(LIBS)
107LFLAGS_DEBUG = DEBUG CODEVIEW option cvpack
108
109!IFDEF DEBUG
110CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)
111LFLAGS = $(LFLAGS) $(LFLAGS_DEBUG)
112!ENDIF
113
114###############################################################################
115# Object/source dependencies
116
117init.obj: init.asm wmakefile
118
119libc.obj: libc.c wmakefile $(INCS)
120
121os2ahci.obj: os2ahci.c wmakefile $(INCS)
122
123pci.obj: pci.c wmakefile $(INCS)
124
125ahci.obj: ahci.c wmakefile $(INCS) ata.h atapi.h
126
127ata.obj: ata.c wmakefile $(INCS) ata.h
128
129atapi.obj: atapi.c wmakefile $(INCS) ata.h atapi.h
130
131ctxhook.obj: ctxhook.c wmakefile $(INCS)
132
133###############################################################################
134# Action definitions (compile/link commands)
135
136.asm.obj:
137 $(AS) $(AFLAGS) $(AS_INCLUDE) $*.asm -fo=$*.obj
138
139.c.obj:
140 $(CC) $(CFLAGS) $(CC_INCLUDE) $*.c
141
142$(TARGET): $(OBJS) os2ahci.def wmakefile
143 $(LD) $(LFLAGS)
144
Note: See TracBrowser for help on using the repository browser.