| [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 |
|
|---|
| 31 | AS = wasm # Watcom assembler
|
|---|
| 32 | CC = wcc # Watcom 16bit compiler
|
|---|
| 33 | LD = 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 |
|
|---|
| 46 | DDK = $(%DDK)
|
|---|
| 47 | WATCOM = $(%WATCOM)
|
|---|
| 48 | !ifndef %PS
|
|---|
| 49 | PS = \
|
|---|
| 50 | !else
|
|---|
| 51 | PS = $(%PS)
|
|---|
| 52 | !endif
|
|---|
| 53 |
|
|---|
| 54 | CC_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 |
|
|---|
| 59 | AS_INCLUDE = -I$(DDK)$(PS)BASE$(PS)INC &
|
|---|
| 60 | -I$(DDK)$(PS)BASE$(PS)SRC$(PS)DEV$(PS)DASD$(PS)DISKINC
|
|---|
| 61 |
|
|---|
| 62 | LIB_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 |
|
|---|
| 70 | TARGET = os2ahci.add
|
|---|
| 71 |
|
|---|
| 72 | LIBS = addcalls dhcalls doscalls slibcep rmcalls
|
|---|
| 73 |
|
|---|
| 74 | SRCS = init.asm libc.c os2ahci.c pci.c ahci.c ata.c atapi.c ctxhook.c
|
|---|
| 75 |
|
|---|
| 76 | OBJS = init.obj libc.obj os2ahci.obj pci.obj ahci.obj ata.obj atapi.obj &
|
|---|
| 77 | ctxhook.obj
|
|---|
| 78 |
|
|---|
| 79 | INCS = os2ahci.h ahci.h
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 | all: $(TARGET)
|
|---|
| 83 |
|
|---|
| 84 | clean:
|
|---|
| 85 | rm -f $(OBJS) $(TARGET)
|
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 | ###############################################################################
|
|---|
| 89 | # compiler/linker flags
|
|---|
| 90 |
|
|---|
| 91 | AFLAGS = -2 -bt=os2 -w3 -zq -ms
|
|---|
| 92 | CFLAGS = -bt=os2 -ms -s -zdp -zff -zgf -zu -zl -2 -w2 -wcd=138 -zp=1
|
|---|
| 93 | CFLAGS_DEBUG = -d3 -hc
|
|---|
| 94 | LFLAGS = name $(TARGET) sys os2 dll initglobal option map quiet &
|
|---|
| 95 | libpath $(LIB_DIRS) lib os2 file $(OBJS) library $(LIBS)
|
|---|
| 96 | LFLAGS_DEBUG = DEBUG CODEVIEW option cvpack
|
|---|
| 97 |
|
|---|
| 98 | !IFDEF DEBUG
|
|---|
| 99 | CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)
|
|---|
| 100 | LFLAGS = $(LFLAGS) $(LFLAGS_DEBUG)
|
|---|
| 101 | !ENDIF
|
|---|
| 102 |
|
|---|
| 103 | ###############################################################################
|
|---|
| 104 | # Object/source dependencies
|
|---|
| 105 |
|
|---|
| 106 | init.obj: init.asm wmakefile
|
|---|
| 107 |
|
|---|
| 108 | libc.obj: libc.c wmakefile $(INCS)
|
|---|
| 109 |
|
|---|
| 110 | os2ahci.obj: os2ahci.c wmakefile $(INCS)
|
|---|
| 111 |
|
|---|
| 112 | pci.obj: pci.c wmakefile $(INCS)
|
|---|
| 113 |
|
|---|
| 114 | ahci.obj: ahci.c wmakefile $(INCS) ata.h atapi.h
|
|---|
| 115 |
|
|---|
| 116 | ata.obj: ata.c wmakefile $(INCS) ata.h
|
|---|
| 117 |
|
|---|
| 118 | atapi.obj: atapi.c wmakefile $(INCS) ata.h atapi.h
|
|---|
| 119 |
|
|---|
| 120 | ctxhook.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 |
|
|---|