Index: trunk/src/wmakefile
===================================================================
--- trunk/src/wmakefile	(revision 7)
+++ trunk/src/wmakefile	(revision 7)
@@ -0,0 +1,134 @@
+###############################################################################
+#
+# wmakefile - Watcom makefile for os2ahci driver
+#
+# NOTE: This is a wmake file! See here:
+# http://www.openwatcom.org/index.php/Using_wmake
+#
+
+#
+# Copyright (c) 2010 Markus Thielen, Christian Mueller. 
+# Parts copied from/inspired by the Linux AHCI driver; 
+# those parts are (c) Linux AHCI/ATA maintainers
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+###############################################################################
+# Tool Chain
+
+AS            = wasm    # Watcom assembler  
+CC            = wcc     # Watcom 16bit compiler
+LD            = wlink   # Watcom linker
+
+
+###############################################################################
+# Environment
+#
+# we need the following set before this makefile is called:
+#
+# WATCOM - to the base WATCOM installation directory
+# DDK    - to the base dir of the OS/2 DDK to use
+# PS     - the path separator (/ or \)
+#
+
+DDK          = $(%DDK)
+WATCOM       = $(%WATCOM)
+!ifndef %PS
+PS           = \
+!else
+PS           = $(%PS)
+!endif
+
+CC_INCLUDE   = -I$(DDK)$(PS)BASE$(PS)H &
+               -I$(DDK)$(PS)BASE$(PS)IBMH &
+               -I$(DDK)$(PS)BASE$(PS)SRC$(PS)DEV$(PS)DASD$(PS)DISKH &
+               -I$(WATCOM)$(PS)h &
+
+AS_INCLUDE   = -I$(DDK)$(PS)BASE$(PS)INC &
+               -I$(DDK)$(PS)BASE$(PS)SRC$(PS)DEV$(PS)DASD$(PS)DISKINC
+
+LIB_DIRS     = $(DDK)$(PS)BASE$(PS)LIB$(PS); &
+               $(DDK)$(PS)BASE$(PS)SRC$(PS)DEV$(PS)DASD$(PS)DEVHLP$(PS); &
+               $(WATCOM)$(PS)LIB$(PS);
+
+
+###############################################################################
+# Main dependencies
+
+TARGET   = os2ahci.add
+
+LIBS     = addcalls dhcalls doscalls slibcep rmcalls
+
+SRCS     = init.asm libc.c os2ahci.c pci.c ahci.c ata.c atapi.c ctxhook.c
+
+OBJS     = init.obj libc.obj os2ahci.obj pci.obj ahci.obj ata.obj atapi.obj &
+           ctxhook.obj
+
+INCS     = os2ahci.h ahci.h
+
+
+all: $(TARGET)
+
+clean:
+	rm -f $(OBJS) $(TARGET)
+
+
+###############################################################################
+# compiler/linker flags
+
+AFLAGS        = -2 -bt=os2 -w3 -zq -ms
+CFLAGS        = -bt=os2 -ms -s -zdp -zff -zgf -zu -zl -2 -w2 -wcd=138 -zp=1
+CFLAGS_DEBUG  = -d3 -hc
+LFLAGS        = name $(TARGET) sys os2 dll initglobal option map quiet &
+                libpath $(LIB_DIRS) lib os2 file $(OBJS) library $(LIBS)
+LFLAGS_DEBUG  = DEBUG CODEVIEW option cvpack
+
+!IFDEF DEBUG
+CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)
+LFLAGS = $(LFLAGS) $(LFLAGS_DEBUG)
+!ENDIF
+
+###############################################################################
+# Object/source dependencies
+
+init.obj:     init.asm   wmakefile
+
+libc.obj:     libc.c     wmakefile $(INCS)
+
+os2ahci.obj:  os2ahci.c  wmakefile $(INCS)
+
+pci.obj:      pci.c      wmakefile $(INCS)
+
+ahci.obj:     ahci.c     wmakefile $(INCS) ata.h atapi.h
+
+ata.obj:      ata.c      wmakefile $(INCS) ata.h
+
+atapi.obj:    atapi.c    wmakefile $(INCS) ata.h atapi.h
+
+ctxhook.obj:  ctxhook.c  wmakefile $(INCS)
+
+###############################################################################
+# Action definitions (compile/link commands)
+
+.asm.obj:
+	$(AS) $(AFLAGS) $(AS_INCLUDE) $*.asm -fo=$*.obj
+
+.c.obj:
+	$(CC) $(CFLAGS) $(CC_INCLUDE) $*.c
+
+$(TARGET): $(OBJS) os2ahci.def wmakefile
+	$(LD) $(LFLAGS) 
+
+
