############################################################################### # Makefile - makefile for os2ahci driver # This is an Open Watcom makefile # # Copyright (c) 2010 Christian Mueller, Markus Thielen. # Copyright (c) 2013-2016 David Azarewicz # #define DBG_ALWAYS 0x0000 #define DBG_FUNCBEG 0x0001 #define DBG_FUNCEND 0x0002 #define DBG_ATTACH 0x0004 #define DBG_DETAILED 0x0008 #define DBG_INIT 0x0010 #define DBG_SPECIAL 0x0020 #define DBG_VERBOSE 0x0100 #define DBG_ERROR_ALL 0x800000ff FDEBUG=0x0000 #FIXPACK=Test Build .ERASE .SUFFIXES .SUFFIXES: .lst .obj .c .asm .lib .def # Define default build version if not specified in environment BLD_MAJOR=2 BLD_MINOR=10 # must be 2 digits BLD_REV=0 # not used at this time !ifndef %ROOT !error ROOT must be set in the environment. !endif ROOT=$(%ROOT) !ifndef %WATCOM # if not defined in the environment !error WATCOM must be set in the environment. !endif WATCOM=$(%WATCOM) !ifndef %DDK # if not defined in the environment !error DDK must be set in the environment. !endif DDK=$(%DDK) !ifndef %DRV32KIT !error DRV32KIT must be defined in environment !endif DRV32KIT=$(%DRV32KIT) !ifdef %VENDOR VENDOR=$(%VENDOR) !else VENDOR=Unknown !endif !ifdef %BLD_MAJOR BLD_MAJOR=$(%BLD_MAJOR) !endif !ifdef %BLD_MINOR BLD_MINOR=$(%BLD_MINOR) !endif !ifdef %FIXPACK FIXPACK=$(%FIXPACK) !endif VERSION=$(BLD_MAJOR).$(BLD_MINOR) ZIPDIR=$(ROOT)\tmp !if "$(FIXPACK)"!="" !ifndef %BLD_DATE !error BLD_DATE must be defined for test versions !endif WPIFILE=$(ROOT)\AHCI-$(VERSION)-$(%BLD_DATE)-WPI.zip !else WPIFILE=$(ROOT)\AHCI-$(VERSION)-WPI.zip !endif AS_INCLUDE = -I=$(DDK)\base\inc %INCLUDE=.;$(ROOT)\src\include;$(DRV32KIT);$(WATCOM)\H;$(DDK)\base\h;$(DDK)\base32\h; %PATH=$(ROOT)\Tools;$(TOOLKIT)\bin;$(DDK)\base\tools;$(WATCOM)\BINP;$(WATCOM)\BINW;$(%PATH) AS=wasm CC=wcc386 MAPSYM=mapsym.exe !ifdef __LOADDLL__ !loaddll wcc386 $(WATCOM)\BINP\DLL\wccd386.dll !loaddll wlink $(WATCOM)\BINP\DLL\wlinkd.dll !endif AFLAGS=-q -6p -bt=os2 -wx -d1 CFLAGS =-q -bt=os2 -6s -olinar -s -ze -zl -zq -zfp -zgp -ms -wx -zp1 -ecs -ei -za99 !ifdef DEBUG CDEFS=-DDEBUG=$(FDEBUG) O=Debug !else CDEFS= O=Retail !endif !ifdef FIXPACK CDEFS+= -DTESTVER !endif LIBS = $(DRV32KIT)\Drv32.lib $(DDK)\base32\lib\kee.lib OBJS = $(O)\os2ahci.obj $(O)\pci.obj $(O)\ahci.obj $(O)\ata.obj $(O)\atapi.obj & $(O)\ctxhook.obj $(O)\trace.obj $(O)\ioctl.obj $(O)\apm.obj $(O)\thunk.obj .asm.obj: .autodepend $(AS) $(AFLAGS) -fo=$^@ $[@ #wdis -l $^@ .c.obj: .autodepend $(CC) $(CFLAGS) $(CDEFS) -fo=$^@ $[@ wdis -l $^@ all: directory $(O)\os2ahci.add $(O)\os2ahci.sym directory: .symbolic $(ROOT)\Tools\createpath.cmd $(O) version.h: Makefile .always @%create $^@ @%append $^@ /* Autogenerated by Makefile */ @AddToFile $^@,$#define DMAJOR,VERSIONMAJOR,$(VERSION) @AddToFile $^@,$#define DMINOR,VERSIONMINOR,$(VERSION) @%append $^@ $#define DVENDOR "$(VENDOR)" @AddToFile $^@,$#define BLD_YEAR,DATEYEAR @AddToFile $^@,$#define BLD_MONTH,DATEMONTH @AddToFile $^@,$#define BLD_DAY,DATEDAY @AddToFile $^@,$#define BLDLEVEL,BLDLEVEL2,$(VENDOR),$(VERSION),AHCI Driver (c) %Y $(VENDOR),$(FIXPACK) $(O)\os2ahci.add: version.h $(OBJS) Makefile @%create $^&.lrf @%append $^&.lrf format os2 lx phys @%append $^&.lrf option mixed1632,nostub,align=4 @%append $^&.lrf option quiet,int,verbose,nocaseexact,eliminate @%append $^&.lrf option map=$^*.map @%append $^&.lrf option stack=0 @%append $^&.lrf sort global @%append $^&.lrf option osname='ArcaOS' @%append $^&.lrf name $^@ @%append $^&.lrf file $(DRV32KIT)\Drv32.lib(header) @for %f in ($(OBJS)) do @%append $^&.lrf file %f @for %f in ($(LIBS)) do @%append $^&.lrf library %f @wlink @$^&.lrf @%erase $^&.lrf $(O)\os2ahci.sym: $(O)\os2ahci.map wat2map.cmd $[@ $^*.ma1 cd $(O) $(MAPSYM) $^&.ma1 @%erase $^&.ma1 cd .. release: .symbolic @if exist $(WPIFILE) @del $(WPIFILE) @!rm -rf $(ZIPDIR) @md $(ZIPDIR) @md $(ZIPDIR)\pkg1 copy /b $(ROOT)\src\os2ahci\$(O)\os2ahci.add $(ZIPDIR)\pkg1 >NUL copy /b $(ROOT)\src\os2ahci\$(O)\os2ahci.sym $(ZIPDIR)\pkg1 >NUL @md $(ZIPDIR)\pkg20 @copy $(ROOT)\src\os2ahci\ReadMe.txt $(ZIPDIR)\pkg20 >NUL @copy $(ROOT)\Tools\LICENSE $(ZIPDIR)\pkg20 >NUL @md $(ZIPDIR)\wpi @sed -e "s/\\X\\X\\X/\\0\\$(VERSION:.=\\)/" $(ROOT)\Tools\ahci.wis >$(ZIPDIR)\wpi\ahci.wis #@copy $(ROOT)\tools\stub.exe $(ZIPDIR)\wpi >NUL cd $(ZIPDIR) @zip -r -X $(WPIFILE) * @cd $(ROOT) @!rm -rf $(ZIPDIR) clean: .symbolic rm -f *.def *.err *.lnk version.h rm $(ROOT)\AHCI-*-WPI.zip @if exist Debug @!rm -r Debug @if exist Retail @!rm -r Retail