source: trunk/src/wmakefile@ 7

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

added Watcom makefile

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