source: trunk/src/wmakefile@ 12

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

wmakefile changes

  • 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# 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
69LIB_DIRS = $(DDK)$(PS)BASE$(PS)LIB$;$(DDK)$(PS)BASE$(PS)SRC$(PS)DEV$(PS)DASD$(PS)DEVHLP;$(WATCOM)$(PS)LIB;
70
71
72###############################################################################
73# Main dependencies
74
75TARGET = os2ahci.add
76
77LIBS = os2,addcalls,dhcalls,doscalls,rmcalls
78
79SRCS = init.asm libc.c os2ahci.c pci.c ahci.c ata.c atapi.c ctxhook.c
80
81OBJS = init.obj libc.obj os2ahci.obj pci.obj ahci.obj ata.obj atapi.obj&
82 ctxhook.obj
83
84# the Watcom linker needs commas between object files
85LDOBJS = init.obj,libc.obj,os2ahci.obj,pci.obj,ahci.obj,ata.obj,atapi.obj,&
86 ctxhook.obj
87
88INCS = os2ahci.h ahci.h
89
90
91all: $(TARGET)
92
93clean:
94 rm -f $(OBJS) $(TARGET)
95
96
97###############################################################################
98# compiler/linker flags
99
100AFLAGS = -2 -bt=os2 -w3 -zq -ms -zcm
101CFLAGS = -bt=os2 -ms -s -zdp -zff -zgf -zu -zl -2 -w2 -wcd=138 -zp=1 -q
102CFLAGS_DEBUG = -d3 -hc
103LFLAGS = name $(TARGET) sys os2 dll initglobal option map option quiet &
104 option nodefaultlibs libpath $(LIB_DIRS) file $(LDOBJS) &
105 library $(LIBS)
106LFLAGS_DEBUG = DEBUG CODEVIEW option cvpack
107
108!IFDEF DEBUG
109CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)
110LFLAGS = $(LFLAGS) $(LFLAGS_DEBUG)
111!ENDIF
112
113###############################################################################
114# Object/source dependencies
115
116init.obj: init.asm wmakefile
117
118libc.obj: libc.c wmakefile $(INCS)
119
120os2ahci.obj: os2ahci.c wmakefile $(INCS)
121
122pci.obj: pci.c wmakefile $(INCS)
123
124ahci.obj: ahci.c wmakefile $(INCS) ata.h atapi.h
125
126ata.obj: ata.c wmakefile $(INCS) ata.h
127
128atapi.obj: atapi.c wmakefile $(INCS) ata.h atapi.h
129
130ctxhook.obj: ctxhook.c wmakefile $(INCS)
131
132###############################################################################
133# Action definitions (compile/link commands)
134
135.asm.obj:
136 $(AS) $(AFLAGS) $(AS_INCLUDE) $*.asm -fo=$*.obj
137
138.c.obj:
139 $(CC) $(CFLAGS) $(CC_INCLUDE) $*.c
140
141$(TARGET): $(OBJS) os2ahci.def wmakefile
142 $(LD) $(LFLAGS)
143
144
Note: See TracBrowser for help on using the repository browser.