Ignore:
Timestamp:
Dec 9, 2016, 8:18:01 PM (9 years ago)
Author:
David Azarewicz
Message:

Build system updates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/Makefile

    r176 r180  
    44#
    55# Copyright (c) 2010 Christian Mueller, Markus Thielen.
    6 # Copyright (c) 2013-2015 David Azarewicz
    7 # Parts copied from/inspired by the Linux AHCI driver;
    8 # those parts are (c) Linux AHCI/ATA maintainers
     6# Copyright (c) 2013-2016 David Azarewicz
    97#
    10 #  This program is free software; you can redistribute it and/or modify
    11 #  it under the terms of the GNU General Public License as published by
    12 #  the Free Software Foundation; either version 2 of the License, or
    13 #  (at your option) any later version.
    14 #
    15 #  This program is distributed in the hope that it will be useful,
    16 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
    17 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    18 #  GNU General Public License for more details.
    19 #
    20 #  You should have received a copy of the GNU General Public License
    21 #  along with this program; if not, write to the Free Software
    22 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    23 ###############################################################################
    24 # Environment
    25 
    268.ERASE
    279.SUFFIXES
     
    2911
    3012# Define default build version if not specified in environment
    31 BLD_MAJOR=1
    32 BLD_MINOR=32 # must be 2 digits
     13BLD_MAJOR=2
     14BLD_MINOR=01 # must be 2 digits
    3315BLD_REV=0 # not used at this time
    34 FIXPACK=
     16FIXPACK=Test Build
    3517
    3618!ifndef %ROOT
     
    5032DDK=$(%DDK)
    5133
     34!ifndef %DRV32KIT
     35!error DRV32KIT must be defined in environment
     36!endif
     37DRV32KIT=$(%DRV32KIT)
     38
    5239!ifdef %VENDOR
    5340VENDOR=$(%VENDOR)
     
    7158!error BLD_DATE must be defined for test versions
    7259!endif
    73 WPIFILE=$(ROOT)\AHCI-test-$(VERSION)-$(%BLD_DATE)-WPI.zip
     60WPIFILE=$(ROOT)\AHCI-$(VERSION)-$(%BLD_DATE)-WPI.zip
    7461!else
    7562WPIFILE=$(ROOT)\AHCI-$(VERSION)-WPI.zip
     
    7764
    7865AS_INCLUDE = -I=$(DDK)\base\inc
    79 LIB_DIRS = $(DDK)\base\lib\
    80 
    81 ###############################################################################
    82 # Tool Chain
    83 #
    84 # This makefile uses the Watcom 16-bit compiler, Watcom Assembler and Linker.
    85 # The updated DDK devhelp.h is required and a copy is in the include directory
    86 # of this project.
    87 #
    88 
    89 %INCLUDE=..\include;$(DDK)\base\h;
    90 %PATH=$(ROOT)\tools;$(WATCOM)\BINP;$(WATCOM)\BINW;$(DDK)\base\tools;$(%PATH)
     66
     67%INCLUDE=.;$(ROOT)\src\include;$(DRV32KIT);$(WATCOM)\H;$(DDK)\base\h;$(DDK)\base32\h;
     68%PATH=$(ROOT)\Tools;$(TOOLKIT)\bin;$(DDK)\base\tools;$(WATCOM)\BINP;$(WATCOM)\BINW;$(%PATH)
     69
    9170AS=wasm
    92 CC=wcc
     71CC=wcc386
    9372MAPSYM=mapsym.exe
    9473
     
    9877!endif
    9978
    100 AFLAGS = -q
    101 CFLAGS= -ei -6 -d0 -bt=os2 -ms -zu -wx -ecc -zp1 -q -s -zgp -zfp -oi
    102 CFLAGS_DEBUG = -ei -6 -d3 -hc -bt=os2 -ms -zu -ecc -zp1 -q -s -zgp -zfp -od
     79#DAZ need to find which structures need pack(1) so we can reset this back to -zp4
     80AFLAGS=-q -6p -bt=os2 -wx -d1
     81CFLAGS =-q -bt=os2 -6s -olinar -s -ze -zl -zq -zfp -zgp -ms -wx -zp1 -ecs -ei -za99
     82CFLAGS_DEBUG=-q -bt=os2 -6s -olinar -s -ze -zl -zq -zfp -zgp -ms -wx -zp1 -ecs -ei -za99
    10383!ifneq FIXPACK
    10484CFLAGS+= -DTESTVER
     
    10888# Main dependencies
    10989
    110 LIBS = addcalls doscalls rmcalls apmcalls os2286p.lib
    111 
    112 SRCS = init.asm math.asm libc.c os2ahci.c pci.c ahci.c ata.c atapi.c &
    113        ctxhook.c trace.c ioctl.c apm.c
    114 
    115 OBJS = init.obj libc.obj os2ahci.obj pci.obj ahci.obj ata.obj atapi.obj &
    116        ctxhook.obj trace.obj ioctl.obj apm.obj
     90LIBS = $(DRV32KIT)\Drv32.lib $(DDK)\base32\lib\kee.lib
     91
     92OBJS = os2ahci.obj pci.obj ahci.obj ata.obj atapi.obj &
     93       ctxhook.obj trace.obj ioctl.obj apm.obj thunk.obj
    11794
    11895INCS = os2ahci.h ahci.h
     
    12198
    12299clean: .symbolic
    123     rm -f $(OBJS) os2ahci.add *.cod *.lst *.def *.map *.sym *.err *.lnk version.h
     100  rm -f $(OBJS) os2ahci.add *.cod *.lst *.def *.map *.sym *.err *.lnk version.h
    124101
    125102###############################################################################
    126103# Object/source dependencies
    127104
    128 libc.obj: libc.c Makefile $(INCS)
    129 
    130105os2ahci.obj: os2ahci.c Makefile $(INCS) version.h ioctl.h
    131106
     
    149124# Action definitions (compile/link commands)
    150125
    151 # emacs TAGS file creation
    152 # NOTE: OS/2 emacs etags.exe expects an empty file named c:\dev\null...
    153 tags:   $(SRCS) $(INCS)
    154     etags.exe $(SRCS) $(INCS)
    155 
    156126version.h: Makefile .always
    157     @%create $^@
    158     @%append $^@ /* Autogenerated by Makefile */
    159     @%append $^@ $#define DMAJOR $(BLD_MAJOR)
    160     @%append $^@ $#define DMINOR $(BLD_MINOR)
    161     @%append $^@ $#define DVENDOR "$(VENDOR)"
    162     @AddToFile $^@,$#define BLD_YEAR,DATEYEAR
    163     @AddToFile $^@,$#define BLD_MONTH,DATEMONTH
    164     @AddToFile $^@,$#define BLD_DAY,DATEDAY
    165     @AddToFile $^@,$#define BLDLEVEL,BLDLEVEL2,$(VENDOR),$(VERSION),AHCI Driver (c) 2015 $(VENDOR),$(FIXPACK)
     127  @%create $^@
     128  @%append $^@ /* Autogenerated by Makefile */
     129  @%append $^@ $#define DMAJOR $(BLD_MAJOR)
     130  @%append $^@ $#define DMINOR $(BLD_MINOR)
     131  @%append $^@ $#define DVENDOR "$(VENDOR)"
     132  @AddToFile $^@,$#define BLD_YEAR,DATEYEAR
     133  @AddToFile $^@,$#define BLD_MONTH,DATEMONTH
     134  @AddToFile $^@,$#define BLD_DAY,DATEDAY
     135  @AddToFile $^@,$#define BLDLEVEL,BLDLEVEL2,$(VENDOR),$(VERSION),AHCI Driver (c) %Y $(VENDOR),$(FIXPACK)
    166136
    167137.asm.obj: .autodepend
    168     $(AS) $(AFLAGS) $(AS_INCLUDE) $[@
    169     #wdis -l $^@
     138  $(AS) $(AFLAGS) $(AS_INCLUDE) $[@
     139  #wdis -l $^@
    170140
    171141.c.obj: .autodepend
    172     $(CC) $(CFLAGS) $[@
    173     #wdis -l $^@
    174 
    175 os2ahci.add: $(OBJS) Makefile
    176     # Target name, system and type
    177     @%create $*.lnk
    178     @%append $*.lnk name $*.add
    179     @%append $*.lnk sys os2 dll
    180     # Set various options
    181     @%append $*.lnk option protmode
    182     @%append $*.lnk option map
    183     @%append $*.lnk option quiet
    184     @%append $*.lnk option nocase
    185     @%append $*.lnk option stack=0
    186     # Generate directives for objects, libraries and library search-paths
    187     @for %f in ($(OBJS)) do @%append $*.lnk file %f
    188     @for %f in ($(LIBS)) do @%append $*.lnk lib %f
    189     @for %f in ($(LIB_DIRS)) do @%append $*.lnk libpath %f
    190     # Attributes for the DATA and CODE segments
    191     @%append $*.lnk segment type DATA SHARED
    192     @%append $*.lnk segment type CODE IOPL
    193     # Order segments by class
    194     @%append $*.lnk order
    195     @%append $*.lnk clname 'DATA'
    196     @%append $*.lnk clname 'CONST'
    197     @%append $*.lnk clname 'BSS'
    198     @%append $*.lnk clname 'CODE'
    199     # Link the stuff together and build the target
    200     wlink  @$*.lnk
    201     @%erase $*.lnk
     142  $(CC) $(CFLAGS) $[@
     143  wdis -l $^@
     144
     145os2ahci.add: version.h $(OBJS) makefile
     146  @%create $^&.lrf
     147  @%append $^&.lrf format os2 lx phys
     148  @%append $^&.lrf option mixed1632,nostub,align=4
     149  @%append $^&.lrf option quiet,int,verbose,nocaseexact,eliminate
     150  @%append $^&.lrf option map=$^*.map
     151  @%append $^&.lrf option stack=0
     152  #  @%append $*.lnk option protmode
     153  @%append $^&.lrf sort global
     154  @%append $^&.lrf option osname='ArcaOS'
     155  @%append $^&.lrf name $^@
     156  @%append $^&.lrf file $(DRV32KIT)\Drv32.lib(header)
     157  @for %f in ($(OBJS)) do @%append $^&.lrf file %f
     158  @for %f in ($(LIBS)) do @%append $^&.lrf library %f
     159  #  @%append $*.lnk segment type DATA SHARED
     160  #  @%append $*.lnk segment type CODE IOPL
     161  #  # Order segments by class
     162  #  @%append $*.lnk order
     163  #  @%append $*.lnk clname 'DATA'
     164  #  @%append $*.lnk clname 'CONST'
     165  #  @%append $*.lnk clname 'BSS'
     166  #  @%append $*.lnk clname 'CODE'
     167  @wlink @$^&.lrf
     168  @%erase $^&.lrf
    202169
    203170os2ahci.sym: os2ahci.map
    204     wat2map.cmd $[@ $^*.ma1
    205     $(MAPSYM) $^*.ma1
    206     @%erase $^*.ma1
     171  wat2map.cmd $[@ $^*.ma1
     172  $(MAPSYM) $^*.ma1
     173  @%erase $^*.ma1
    207174
    208175release: os2ahci.add os2ahci.sym .symbolic
     
    221188
    222189  @md $(ZIPDIR)\pkg20
    223   @copy $(ROOT)\src\os2ahci\README $(ZIPDIR)\pkg20 >NUL
     190  @copy $(ROOT)\src\os2ahci\ReadMe.txt $(ZIPDIR)\pkg20 >NUL
    224191  @copy $(ROOT)\Tools\LICENSE $(ZIPDIR)\pkg20 >NUL
    225192
Note: See TracChangeset for help on using the changeset viewer.