Ignore:
Timestamp:
Dec 15, 2016, 12:31:51 AM (9 years ago)
Author:
David Azarewicz
Message:

Reworked makefile
Fixed context hook logic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/Makefile

    r180 r184  
    1414BLD_MINOR=01 # must be 2 digits
    1515BLD_REV=0 # not used at this time
    16 FIXPACK=Test Build
    1716
    1817!ifndef %ROOT
    19 ROOT=$+$(%cwd)$-
    20 !else
     18!error ROOT must be set in the environment.
     19!endif
    2120ROOT=$(%ROOT)
    22 !endif
    2321
    2422!ifndef %WATCOM # if not defined in the environment
     
    5149!endif
    5250
     51!ifdef %FIXPACK
     52FIXPACK=$(%FIXPACK)
     53!endif
     54
    5355VERSION=$(BLD_MAJOR).$(BLD_MINOR)
    5456ZIPDIR=$(ROOT)\tmp
     
    7375
    7476!ifdef __LOADDLL__
    75 !loaddll wcc   $(WATCOM)\BINP\DLL\wccd.dll
     77!loaddll wcc386   $(WATCOM)\BINP\DLL\wccd386.dll
    7678!loaddll wlink $(WATCOM)\BINP\DLL\wlinkd.dll
    7779!endif
     
    8082AFLAGS=-q -6p -bt=os2 -wx -d1
    8183CFLAGS =-q -bt=os2 -6s -olinar -s -ze -zl -zq -zfp -zgp -ms -wx -zp1 -ecs -ei -za99
    82 CFLAGS_DEBUG=-q -bt=os2 -6s -olinar -s -ze -zl -zq -zfp -zgp -ms -wx -zp1 -ecs -ei -za99
    83 !ifneq FIXPACK
    84 CFLAGS+= -DTESTVER
     84
     85!ifdef DEBUG
     86CDEFS=-DDEBUG
     87O=Debug
     88!else
     89CDEFS=
     90O=Retail
    8591!endif
    8692
    87 ###############################################################################
    88 # Main dependencies
     93!ifneq FIXPACK
     94CDEFS+= -DTESTVER
     95!endif
    8996
    9097LIBS = $(DRV32KIT)\Drv32.lib $(DDK)\base32\lib\kee.lib
    9198
    92 OBJS = os2ahci.obj pci.obj ahci.obj ata.obj atapi.obj &
    93        ctxhook.obj trace.obj ioctl.obj apm.obj thunk.obj
     99OBJS = $(O)\os2ahci.obj $(O)\pci.obj $(O)\ahci.obj $(O)\ata.obj $(O)\atapi.obj &
     100       $(O)\ctxhook.obj $(O)\trace.obj $(O)\ioctl.obj $(O)\apm.obj $(O)\thunk.obj
    94101
    95 INCS = os2ahci.h ahci.h
     102.asm.obj: .autodepend
     103  $(AS) $(AFLAGS) -fo=$^@ $[@
     104  #wdis -l $^@
    96105
    97 all: os2ahci.add os2ahci.sym
     106.c.obj: .autodepend
     107  $(CC) $(CFLAGS) $(CDEFS) -fo=$^@ $[@
     108  wdis -l $^@
    98109
    99 clean: .symbolic
    100   rm -f $(OBJS) os2ahci.add *.cod *.lst *.def *.map *.sym *.err *.lnk version.h
     110all: directory $(O)\os2ahci.add $(O)\os2ahci.sym
    101111
    102 ###############################################################################
    103 # Object/source dependencies
    104 
    105 os2ahci.obj: os2ahci.c Makefile $(INCS) version.h ioctl.h
    106 
    107 pci.obj: pci.c Makefile $(INCS)
    108 
    109 ahci.obj: ahci.c Makefile $(INCS) ata.h atapi.h
    110 
    111 ata.obj: ata.c Makefile $(INCS) ata.h
    112 
    113 atapi.obj: atapi.c Makefile $(INCS) atapi.h ata.h
    114 
    115 ctxhook.obj: ctxhook.c Makefile $(INCS) ata.h atapi.h
    116 
    117 apm.obj: apm.c Makefile $(INCS)
    118 
    119 ioctl.obj: ioctl.c Makefile $(INCS) ioctl.h atapi.h
    120 
    121 trace.obj: trace.c Makefile $(INCS)
    122 
    123 ###############################################################################
    124 # Action definitions (compile/link commands)
     112directory: .symbolic
     113  $(ROOT)\Tools\createpath.cmd $(O)
    125114
    126115version.h: Makefile .always
     
    135124  @AddToFile $^@,$#define BLDLEVEL,BLDLEVEL2,$(VENDOR),$(VERSION),AHCI Driver (c) %Y $(VENDOR),$(FIXPACK)
    136125
    137 .asm.obj: .autodepend
    138   $(AS) $(AFLAGS) $(AS_INCLUDE) $[@
    139   #wdis -l $^@
    140 
    141 .c.obj: .autodepend
    142   $(CC) $(CFLAGS) $[@
    143   wdis -l $^@
    144 
    145 os2ahci.add: version.h $(OBJS) makefile
     126$(O)\os2ahci.add: version.h $(OBJS) Makefile
    146127  @%create $^&.lrf
    147128  @%append $^&.lrf format os2 lx phys
     
    168149  @%erase $^&.lrf
    169150
    170 os2ahci.sym: os2ahci.map
     151$(O)\os2ahci.sym: $(O)\os2ahci.map
    171152  wat2map.cmd $[@ $^*.ma1
    172   $(MAPSYM) $^*.ma1
    173   @%erase $^*.ma1
     153  cd $(O)
     154  $(MAPSYM) $^&.ma1
     155  @%erase $^&.ma1
     156  cd ..
    174157
    175 release: os2ahci.add os2ahci.sym .symbolic
     158release: $(O)\os2ahci.add $(O)\os2ahci.sym .symbolic
    176159  @if exist $(WPIFILE) @del $(WPIFILE)
    177160  @!rm -rf $(ZIPDIR)
     
    180163
    181164  @md $(ZIPDIR)\pkg1
    182   @copy /b $(ROOT)\src\os2ahci\os2ahci.add $(ZIPDIR)\pkg1 >NUL
    183   @copy /b $(ROOT)\src\os2ahci\os2ahci.sym $(ZIPDIR)\pkg1 >NUL
     165  @copy /b $(ROOT)\src\os2ahci\$(O)\os2ahci.add $(ZIPDIR)\pkg1 >NUL
     166  @copy /b $(ROOT)\src\os2ahci\$(O)\os2ahci.sym $(ZIPDIR)\pkg1 >NUL
    184167
    185168  @md $(ZIPDIR)\pkg2
     
    200183  @!rm -rf $(ZIPDIR)
    201184
     185clean: .symbolic
     186  rm -f *.def *.err *.lnk version.h
     187  @if exist Debug @!rm -r Debug
     188  @if exist Retail @!rm -r Retail
     189
     190
Note: See TracChangeset for help on using the changeset viewer.