Changeset 148 for trunk/src/os2ahci/Makefile
- Timestamp:
- Mar 27, 2013, 5:55:26 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/Makefile
r144 r148 1 1 ############################################################################### 2 # Makefile - makefile for os2ahci driver , c600 tool chain2 # Makefile - makefile for os2ahci driver using WATCOM compiler 3 3 # 4 # Copyright (c) 2011 thi.guten Software Development 5 # Copyright (c) 2011 Mensys B.V. 6 # 7 # Authors: Christian Mueller, Markus Thielen 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 8 7 # 9 8 # This program is free software; you can redistribute it and/or modify … … 20 19 # along with this program; if not, write to the Free Software 21 20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 # 21 22 23 ############################################################################### 24 # Environment 25 26 .ERASE 27 .SUFFIXES 28 .SUFFIXES: .lst .obj .c .asm .lib .def 29 30 # Define default build version if not specified in environment 31 BLD_MAJOR=1 32 BLD_MINOR=26 # must be 2 digits 33 BLD_REV=0 # not used at this time 34 35 !ifndef %WATCOM # if not defined in the environment 36 !error WATCOM must be set in the environment. 37 !endif 38 WATCOM=$(%WATCOM) 39 40 !ifndef %DDK # if not defined in the environment 41 !error DDK must be set in the environment. 42 !endif 43 DDK=$(%DDK) 44 45 !ifdef %VENDOR 46 VENDOR=$(%VENDOR) 47 !else 48 VENDOR=Mensys BV 49 !endif 50 51 !ifdef %BLD_MAJOR 52 BLD_MAJOR=$(%BLD_MAJOR) 53 !endif 54 55 !ifdef %BLD_MINOR 56 BLD_MINOR=$(%BLD_MINOR) 57 !endif 58 59 CC_INCLUDE = -I..\include & 60 -I$(DDK)\base\h & 61 -I$(DDK)\base\ibmh & 62 -I$(DDK)\base\src\dev\dasd\diskh & 63 -I$(DDK)\base\src\dev\thinkpad\dockii\apmcalls & 64 65 AS_INCLUDE = -I=$(DDK)\base\inc & 66 -I=$(DDK)\base\src\dev\dasd\diskinc 67 68 LIB_DIRS = $(DDK)\base\lib\ & 69 $(DDK)\base\src\dev\dasd\devhlp\ & 70 $(DDK)\base\src\dev\thinkpad\dockii\apmcalls\ 23 71 24 72 ############################################################################### 25 73 # Tool Chain 26 74 # 75 # This makefile uses the Watcom 16-bit compiler, Watcom Assembler and Linker. 76 # The updated DDK devhelp.h is required and a copy is in the include directory 77 # of this project. 78 # 27 79 28 AS = $(DDK)\tools\alp.exe 29 CC = cl 30 LD = $(DDK)\base\tools\link.exe 80 %PATH=..\..\tools;$(WATCOM)\BINP;$(WATCOM)\BINW; 81 AS = wasm 82 CC = wcc 31 83 MAPSYM = $(DDK)\base\tools\mapsym.exe 32 BLDLEVEL = cmd.exe /c ..\..\tools\bldlvl.cmd33 BLDDATE = cmd.exe /c ..\..\tools\blddate.cmd34 84 35 AFLAGS = -Mb 36 CFLAGS = -c -nologo -Asnw -W2 -G2ms -Zlpd -Fc -Zi -DECS_BUILD 37 LFLAGS = /noe /nod /packd /a:16 /batch /map /line 38 39 ############################################################################### 40 # Environment 41 42 # main path to OS/2 DDK; this needs to be set before this makefile will work 43 !ifndef DDK 44 DDK = i:\ddk 85 !ifdef __LOADDLL__ 86 !loaddll wcc $(WATCOM)\BINP\DLL\wccd.dll 87 !loaddll wlink $(WATCOM)\BINP\DLL\wlinkd.dll 45 88 !endif 46 89 47 # main path to 16 bit C compiler 48 !ifndef CC16 49 CC16 = i:\c600 50 !endif 51 52 CC_INCLUDE = -I..\include \ 53 -I$(DDK)\base\h \ 54 -I$(DDK)\base\ibmh \ 55 -I$(DDK)\base\src\dev\dasd\diskh \ 56 -I$(DDK)\base\src\dev\thinkpad\dockii\apmcalls \ 57 # -I$(CC16)\include 58 59 AS_INCLUDE = -I:$(DDK)\base\inc \ 60 -I:$(DDK)\base\src\dev\dasd\diskinc 61 62 LIB_DIRS = $(DDK)\base\lib\ \ 63 $(DDK)\base\src\dev\dasd\devhlp\ \ 64 $(DDK)\base\src\dev\thinkpad\dockii\apmcalls\ \ 65 # $(CC16)\lib\ \ 66 90 AFLAGS = -q 91 #CFLAGS = -ei -5 -d3 -hc -bt=os2 -ms -zu -w3 -wcd=138 -wcd=300 -ecc -zp1 -q -s -zgp -zfp -oi 92 # In order to build the SMP safe version you must have the updated devhelp.h and define OS2AHCI_SMP. 93 CFLAGS = -ei -5 -d0 -bt=os2 -ms -zu -w=0 -ecc -zp=1 -q -s -zgp -zfp -oi -DOS2AHCI_SMP 94 CFLAGS_DEBUG = -ei -5 -d3 -hc -bt=os2 -ms -zu -ecc -zp=1 -q -s -zgp -zfp -od 67 95 68 96 ############################################################################### 69 97 # Main dependencies 70 98 71 TARGET = os2ahci.add 99 LIBS = addcalls doscalls rmcalls apmcalls 72 100 73 LIBS = addcalls dhcalls doscalls slibcep rmcalls apmcalls 101 SRCS = init.asm math.asm libc.c os2ahci.c pci.c ahci.c ata.c atapi.c & 102 ctxhook.c trace.c ioctl.c apm.c 74 103 75 SRCS = init.asm libc.c os2ahci.c pci.c ahci.c ata.c atapi.c ctxhook.c \ 76 apm.c ioctl.c trace.c104 OBJS = init.obj libc.obj os2ahci.obj pci.obj ahci.obj ata.obj atapi.obj & 105 ctxhook.obj trace.obj ioctl.obj apm.obj 77 106 78 OBJS = init.obj libc.obj os2ahci.obj pci.obj ahci.obj ata.obj atapi.obj \ 79 ctxhook.obj apm.obj ioctl.obj trace.obj 107 INCS = os2ahci.h ahci.h 80 108 81 INCS = os2ahci.h ahci.h version.h ioctl.h ..\include\ahci-idc.h 109 all: os2ahci.add os2ahci.sym 82 110 83 84 all: $(TARGET) 85 86 clean: 87 rm -f $(OBJS) $(TARGET) *.cod *.lst *.def *.map *.sym *.err *.lnk \ 88 bldday.h 89 111 clean: .symbolic 112 rm -f $(OBJS) os2ahci.add *.cod *.lst *.def *.map *.sym *.err *.lnk version.h 90 113 91 114 ############################################################################### 92 115 # Object/source dependencies 93 116 94 init.obj: init.asm Makefile 117 libc.obj: libc.c Makefile $(INCS) 95 118 96 libc.obj: libc.c Makefile $(INCS) 119 os2ahci.obj: os2ahci.c Makefile $(INCS) version.h ioctl.h 97 120 98 os2ahci.obj: os2ahci.c Makefile $(INCS) bldday.h ioctl.h 121 pci.obj: pci.c Makefile $(INCS) 99 122 100 pci.obj: pci.c Makefile $(INCS) 123 ahci.obj: ahci.c Makefile $(INCS) ata.h atapi.h 101 124 102 a hci.obj: ahci.c Makefile $(INCS) ata.h atapi.h125 ata.obj: ata.c Makefile $(INCS) ata.h 103 126 104 ata .obj: ata.c Makefile $(INCS)ata.h127 atapi.obj: atapi.c Makefile $(INCS) atapi.h ata.h 105 128 106 atapi.obj: atapi.cMakefile $(INCS) ata.h atapi.h129 ctxhook.obj: ctxhook.c Makefile $(INCS) ata.h atapi.h 107 130 108 ctxhook.obj: ctxhook.c Makefile $(INCS) ata.h atapi.h 131 apm.obj: apm.c Makefile $(INCS) 109 132 110 apm.obj: apm.c Makefile $(INCS) 133 ioctl.obj: ioctl.c Makefile $(INCS) ioctl.h atapi.h 111 134 112 ioctl.obj: ioctl.c Makefile $(INCS) ata.h atapi.h ioctl.h 113 114 trace.obj: trace.c Makefile $(INCS) 115 116 os2ahci.def: version.h os2ahci.def.template 135 trace.obj: trace.c Makefile $(INCS) 117 136 118 137 ############################################################################### … … 121 140 # emacs TAGS file creation 122 141 # NOTE: OS/2 emacs etags.exe expects an empty file named c:\dev\null... 123 tags: $(SRCS) $(INCS) Makefile 124 etags.exe $(SRCS) $(INCS) $(DDK)\base\src\dev\dasd\diskh\dhcalls.h \ 125 $(DDK)\base\src\dev\dasd\diskh\iorb.h \ 126 $(DDK)\base\h\bsedos16.h \ 127 $(DDK)\base\h\devcmd.h \ 128 $(DDK)\base\h\reqpkt.h 142 tags: $(SRCS) $(INCS) 143 etags.exe $(SRCS) $(INCS) 129 144 130 bldday.h: 131 $(BLDDATE) > bldday.h 145 version.h: Makefile .always 146 @%create $^@ 147 @%append $^@ /* Autogenerated by Makefile */ 148 @%append $^@ $#define VERSION $(BLD_MAJOR)$(BLD_MINOR) /* driver version (2 implied decimals) */ 149 @AddToFile $^@,$#define BLD_YEAR,DATEYEAR 150 @AddToFile $^@,$#define BLD_MONTH,DATEMONTH 151 @AddToFile $^@,$#define BLD_DAY,DATEDAY 132 152 133 .asm.obj: 134 $(AS) $(AFLAGS) $(AS_INCLUDE) $*.asm 135 wdis -l $*.obj 153 .asm.obj: .autodepend 154 $(AS) $(AFLAGS) $(AS_INCLUDE) $[@ 155 #wdis -l $^@ 136 156 137 .c.obj: 138 $(CC) $(CFLAGS) $(CC_INCLUDE) $*.c 139 wdis -l $*.obj 157 .c.obj: .autodepend 158 $(CC) $(CFLAGS) $(CC_INCLUDE) $[@ 159 #wdis -l $^@ 140 160 141 os2ahci.def: 142 $(BLDLEVEL) os2ahci.def.template os2ahci.def version.h 161 os2ahci.add: $(OBJS) Makefile 162 # Target name, system and type 163 @%create $*.lnk 164 @%append $*.lnk name $*.add 165 @%append $*.lnk sys os2 dll 166 # Merge BLDLEVEL information 167 @AddToFile.cmd $*.lnk,option description,BLDLEVEL,$(VENDOR),$(BLD_MAJOR).$(BLD_MINOR),AHCI Driver (c) Mensys BV 2013 168 # Set various options 169 @%append $*.lnk option protmode 170 @%append $*.lnk option map 171 @%append $*.lnk option quiet 172 @%append $*.lnk option nocase 173 @%append $*.lnk option stack=0 174 # Generate directives for objects, libraries and library search-paths 175 @for %f in ($(OBJS)) do @%append $*.lnk file %f 176 @for %f in ($(LIBS)) do @%append $*.lnk lib %f 177 @for %f in ($(LIB_DIRS)) do @%append $*.lnk libpath %f 178 # Attributes for the DATA and CODE segments 179 @%append $*.lnk segment type DATA SHARED 180 @%append $*.lnk segment type CODE IOPL 181 # Order segments by class 182 @%append $*.lnk order 183 @%append $*.lnk clname 'DATA' 184 @%append $*.lnk clname 'CONST' 185 @%append $*.lnk clname 'BSS' 186 @%append $*.lnk clname 'CODE' 187 # Link the stuff together and build the target 188 wlink @$*.lnk 189 @%erase $*.lnk 143 190 191 os2ahci.sym: os2ahci.map 192 wat2map.cmd $[@ $^*.ma1 193 $(MAPSYM) $^*.ma1 194 @%erase $^*.ma1 144 195 145 $(TARGET): $(OBJS) os2ahci.def Makefile146 $(LD) $(LFLAGS) $(OBJS),$(TARGET),$*.map,$(LIB_DIRS) $(LIBS),$*.def147 $(MAPSYM) os2ahci
Note:
See TracChangeset
for help on using the changeset viewer.