| 1 | ###############################################################################
|
|---|
| 2 | # wmakefile - makefile for os2ahci driver using WATCOM compiler
|
|---|
| 3 | #
|
|---|
| 4 | # Copyright (c) 2010 Christian Mueller, Markus Thielen.
|
|---|
| 5 | # Parts copied from/inspired by the Linux AHCI driver;
|
|---|
| 6 | # those parts are (c) Linux AHCI/ATA maintainers
|
|---|
| 7 | #
|
|---|
| 8 | # This program is free software; you can redistribute it and/or modify
|
|---|
| 9 | # it under the terms of the GNU General Public License as published by
|
|---|
| 10 | # the Free Software Foundation; either version 2 of the License, or
|
|---|
| 11 | # (at your option) any later version.
|
|---|
| 12 | #
|
|---|
| 13 | # This program is distributed in the hope that it will be useful,
|
|---|
| 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 16 | # GNU General Public License for more details.
|
|---|
| 17 | #
|
|---|
| 18 | # You should have received a copy of the GNU General Public License
|
|---|
| 19 | # along with this program; if not, write to the Free Software
|
|---|
| 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 | ###############################################################################
|
|---|
| 24 | # Environment
|
|---|
| 25 |
|
|---|
| 26 | # main path to OS/2 DDK; this needs to be set before this makefile will work
|
|---|
| 27 | !ifndef DDK
|
|---|
| 28 | DDK = i:\ddk
|
|---|
| 29 | !endif
|
|---|
| 30 |
|
|---|
| 31 | # main path to WATCOM installation
|
|---|
| 32 | !ifndef WATCOM
|
|---|
| 33 | WATCOM = i:\watcom
|
|---|
| 34 | !endif
|
|---|
| 35 |
|
|---|
| 36 | CC_INCLUDE = -I..\include \
|
|---|
| 37 | -I$(DDK)\base\h \
|
|---|
| 38 | -I$(DDK)\base\ibmh \
|
|---|
| 39 | -I$(DDK)\base\src\dev\dasd\diskh \
|
|---|
| 40 | -I$(WATCOM)\h
|
|---|
| 41 |
|
|---|
| 42 | AS_INCLUDE = -I:$(DDK)\base\inc \
|
|---|
| 43 | -I:$(DDK)\base\src\dev\dasd\diskinc
|
|---|
| 44 |
|
|---|
| 45 | LIB_DIRS = $(DDK)\base\lib\ \
|
|---|
| 46 | $(DDK)\base\src\dev\dasd\devhlp\ \
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 | ###############################################################################
|
|---|
| 50 | # Tool Chain
|
|---|
| 51 | #
|
|---|
| 52 | # This makefile uses the Watcom 16bit compiler.
|
|---|
| 53 | # Linker and assembler are link.exe and alp.exe that ship with the OS/2 DDK
|
|---|
| 54 | #
|
|---|
| 55 |
|
|---|
| 56 | AS = $(DDK)\tools\alp.exe
|
|---|
| 57 | CC = wcc
|
|---|
| 58 | LD = $(DDK)\base\tools\link.exe
|
|---|
| 59 | BLDLEVEL = cmd.exe /c ..\..\tools\bldlvl.cmd
|
|---|
| 60 | BLDDATE = cmd.exe /c ..\..\tools\blddate.cmd
|
|---|
| 61 | MAPSYM = $(DDK)\base\tools\mapsym.exe
|
|---|
| 62 |
|
|---|
| 63 | AFLAGS = -Mb
|
|---|
| 64 | CFLAGS = -d3 -hc -bt=os2 -ms -zu -5 -w2 -wcd=138 -zp1 -q -s -zgp -zfp -oi
|
|---|
| 65 | CFLAGS_DEBUG = -d3 -hc
|
|---|
| 66 | LFLAGS = /noe /nod /packd /a:16 /batch /map /line
|
|---|
| 67 |
|
|---|
| 68 | ###############################################################################
|
|---|
| 69 | # Main dependencies
|
|---|
| 70 |
|
|---|
| 71 | TARGET = os2ahci.add
|
|---|
| 72 |
|
|---|
| 73 | LIBS = addcalls doscalls rmcalls # dhcalls not needed, see local devhelp.h
|
|---|
| 74 |
|
|---|
| 75 | SRCS = init.asm math.asm libc.c os2ahci.c pci.c ahci.c ata.c atapi.c \
|
|---|
| 76 | ctxhook.c
|
|---|
| 77 |
|
|---|
| 78 | OBJS = init.obj libc.obj os2ahci.obj pci.obj ahci.obj ata.obj atapi.obj \
|
|---|
| 79 | ctxhook.obj
|
|---|
| 80 |
|
|---|
| 81 | INCS = os2ahci.h ahci.h version.h
|
|---|
| 82 |
|
|---|
| 83 |
|
|---|
| 84 | all: $(TARGET)
|
|---|
| 85 |
|
|---|
| 86 | clean:
|
|---|
| 87 | rm -f $(OBJS) $(TARGET)
|
|---|
| 88 |
|
|---|
| 89 | ###############################################################################
|
|---|
| 90 | # Object/source dependencies
|
|---|
| 91 |
|
|---|
| 92 | init.obj: init.asm wmakefile
|
|---|
| 93 |
|
|---|
| 94 | libc.obj: libc.c wmakefile $(INCS)
|
|---|
| 95 |
|
|---|
| 96 | os2ahci.obj: os2ahci.c wmakefile $(INCS) bldday.h
|
|---|
| 97 |
|
|---|
| 98 | pci.obj: pci.c wmakefile $(INCS)
|
|---|
| 99 |
|
|---|
| 100 | ahci.obj: ahci.c wmakefile $(INCS) ata.h atapi.h
|
|---|
| 101 |
|
|---|
| 102 | ata.obj: ata.c wmakefile $(INCS) ata.h
|
|---|
| 103 |
|
|---|
| 104 | atapi.obj: atapi.c wmakefile $(INCS) ata.h atapi.h
|
|---|
| 105 |
|
|---|
| 106 | ctxhook.obj: ctxhook.c wmakefile $(INCS) ata.h atapi.h
|
|---|
| 107 |
|
|---|
| 108 | ###############################################################################
|
|---|
| 109 | # Action definitions (compile/link commands)
|
|---|
| 110 |
|
|---|
| 111 | # emacs TAGS file creation
|
|---|
| 112 | # NOTE: OS/2 emacs etags.exe expects an empty file named c:\dev\null...
|
|---|
| 113 | tags: $(SRCS) $(INCS)
|
|---|
| 114 | etags.exe $(SRCS) $(INCS)
|
|---|
| 115 |
|
|---|
| 116 | bldday.h:
|
|---|
| 117 | $(BLDDATE) > bldday.h
|
|---|
| 118 |
|
|---|
| 119 | .asm.obj:
|
|---|
| 120 | $(AS) $(AFLAGS) $(AS_INCLUDE) $*.asm
|
|---|
| 121 |
|
|---|
| 122 | .c.obj:
|
|---|
| 123 | $(CC) $(CFLAGS) $(CC_INCLUDE) $*.c
|
|---|
| 124 | wdis -l $*.obj
|
|---|
| 125 |
|
|---|
| 126 | $(TARGET): $(OBJS) os2ahci.def wmakefile
|
|---|
| 127 | $(BLDLEVEL) os2ahci.def version.h
|
|---|
| 128 | $(LD) $(LFLAGS) $(OBJS),$(TARGET),$*.map,$(LIB_DIRS) $(LIBS),$*.def
|
|---|
| 129 | mapsym os2ahci
|
|---|
| 130 |
|
|---|
| 131 |
|
|---|