source: trunk/src/wmakefile@ 11

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

more fixes to wmakefile

  • Property svn:executable set to *
File size: 4.3 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.ERASE # disable prompt to delete out of date files on compile errors
32
33
34###############################################################################
35# Tool Chain
36
37AS = wasm # Watcom assembler
38CC = wcc # Watcom 16bit compiler
39LD = wlink # Watcom linker
40
41
42###############################################################################
43# Environment
44#
45# we need the following set before this makefile is called:
46#
47# WATCOM - to the base WATCOM installation directory
48# DDK - to the base dir of the OS/2 DDK to use
49# PS - the path separator (/ or \)
50#
51
52DDK = $(%DDK)
53WATCOM = $(%WATCOM)
54!ifndef %PS
55PS = \
56!else
57PS = $(%PS)
58!endif
59
60CC_INCLUDE = -I$(DDK)$(PS)BASE$(PS)H &
61 -I$(DDK)$(PS)BASE$(PS)IBMH &
62 -I$(DDK)$(PS)BASE$(PS)SRC$(PS)DEV$(PS)DASD$(PS)DISKH &
63 -I$(WATCOM)$(PS)h &
64
65AS_INCLUDE = -I$(DDK)$(PS)BASE$(PS)INC &
66 -I$(DDK)$(PS)BASE$(PS)SRC$(PS)DEV$(PS)DASD$(PS)DISKINC
67
68LIB_DIRS = $(DDK)$(PS)BASE$(PS)LIB$(PS);$(DDK)$(PS)BASE$(PS)SRC$(PS)DEV$(PS)DASD$(PS)DEVHLP$(PS);$(WATCOM)$(PS)LIB$(PS);
69
70
71###############################################################################
72# Main dependencies
73
74TARGET = os2ahci.add
75
76LIBS = addcalls,dhcalls,doscalls,rmcalls
77
78SRCS = init.asm libc.c os2ahci.c pci.c ahci.c ata.c atapi.c ctxhook.c
79
80OBJS = init.obj libc.obj os2ahci.obj pci.obj ahci.obj ata.obj atapi.obj&
81 ctxhook.obj
82
83# the Watcom linker needs commas between object files
84LDOBJS = init.obj,libc.obj,os2ahci.obj,pci.obj,ahci.obj,ata.obj,atapi.obj,&
85 ctxhook.obj
86
87INCS = os2ahci.h ahci.h
88
89
90all: $(TARGET)
91
92clean:
93 rm -f $(OBJS) $(TARGET)
94
95
96###############################################################################
97# compiler/linker flags
98
99AFLAGS = -2 -bt=os2 -w3 -zq -ms
100CFLAGS = -bt=os2 -ms -s -zdp -zff -zgf -zu -zl -2 -w2 -wcd=138 -zp=1 -q
101CFLAGS_DEBUG = -d3 -hc
102LFLAGS = name $(TARGET) sys os2 dll initglobal option map option quiet &
103 libpath $(LIB_DIRS) lib os2 file $(LDOBJS) library $(LIBS)
104LFLAGS_DEBUG = DEBUG CODEVIEW option cvpack
105
106!IFDEF DEBUG
107CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)
108LFLAGS = $(LFLAGS) $(LFLAGS_DEBUG)
109!ENDIF
110
111###############################################################################
112# Object/source dependencies
113
114init.obj: init.asm wmakefile
115
116libc.obj: libc.c wmakefile $(INCS)
117
118os2ahci.obj: os2ahci.c wmakefile $(INCS)
119
120pci.obj: pci.c wmakefile $(INCS)
121
122ahci.obj: ahci.c wmakefile $(INCS) ata.h atapi.h
123
124ata.obj: ata.c wmakefile $(INCS) ata.h
125
126atapi.obj: atapi.c wmakefile $(INCS) ata.h atapi.h
127
128ctxhook.obj: ctxhook.c wmakefile $(INCS)
129
130###############################################################################
131# Action definitions (compile/link commands)
132
133.asm.obj:
134 $(AS) $(AFLAGS) $(AS_INCLUDE) $*.asm -fo=$*.obj
135
136.c.obj:
137 $(CC) $(CFLAGS) $(CC_INCLUDE) $*.c
138
139$(TARGET): $(OBJS) os2ahci.def wmakefile
140 $(LD) $(LFLAGS)
141
142
Note: See TracBrowser for help on using the repository browser.