Changeset 60 for trunk/bootcode/Makefile


Ignore:
Timestamp:
Feb 18, 2016, 5:18:51 PM (10 years ago)
Author:
Ben Rietbroek
Message:

Fixed building on Linux [v1.1.1-testing]

Of course the lowercasing broke building on Linux.
This commit fixes that.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bootcode/Makefile

    r55 r60  
    11###############################################################################
    2 # Makefile :: Builds the AIRBOOT.BIN 16-bits RAW Loader Image.                #
     2# Makefile :: Builds the 'airboot.bin' 16-bits RAW Loader Image               #
    33###############################################################################
    44# rousseau@ecomstation.com
    5 #
    6 # Derived from the FIXCODE Makefile.
    7 #
    8 
    9 #
    10 # This Makefile builds the AIRBOOT.BIN program.
     5
     6#
     7# This Makefile builds the 'airboot.bin' program.
    118# This is the actual AiR-BOOT that you see when starting your system.
    129# It operates at the BIOS level and thus without any operating-system
     
    2118# possible virusses. This detection code is "hooked" into the interrupt-chain
    2219# and therefore has it's own relocations which are not related to the main
    23 # loader image. For this reason, when the main source AIR-BOOT.ASM is assembled
    24 # to a RAW image, this virus-protection code is "embedded" as the last step.
    25 # You could compare this to binding a resource-file to an OS/2 executable.
     20# loader image. For this reason, when the main source 'air-boot.asm' is
     21# assembled to a RAW image, this virus-protection code is "embedded" as the
     22# last step. You could compare this to binding a resource-file to an OS/2
     23# executable.
    2624#
    2725# When AiR-BOOT gets control, this virus-protection code is copied elsewhere
     
    3129#
    3230# This embedding proccess consists of three parts:
    33 # - Assembling the virus-detection code, MBR_PROT.ASM, which always results
     31# - Assembling the virus-detection code, 'mbrprot.asm', which always results
    3432#   in a 1024 bytes image.
    35 # - Compiling the FIXCODE program that does the actual embedding.
    36 # - Running the FIXCODE program against AIR-BOOT.COM creating the
    37 #       final AIRBOOT.BIN image.
    38 #
    39 
    40 #
    41 # After these operations have been completed, the AIRBOOT.BIN image
     33# - Compiling the 'fixcode' program that does the actual embedding.
     34# - Running the 'fixcode' program against 'air-boot.com' creating the
     35#       final 'airboot.bin' image.
     36#
     37
     38#
     39# After these operations have been completed, the 'airboot.bin' image
    4240# is ready to be installed.
    4341#
    44 
    45 #
    46 # The installer is a C program for OS/2 and Win32, using Open Watcom's
    47 # cross-platform capabilities. The DOS installer is currently an Assembler
    48 # program, making it harder to maintain and stay in sync with the C version.
    49 # No Linux installer is available yet, but work is in progress.
    50 # In future versions the DOS installer will also be built from the C sources
    51 # as will the Linux version, again using Open Watcom's cross-platform
    52 # capabilities. I call it 'DWOL': DOS, Windows, OS/2 and Linux.
    53 #
    54 
    5542
    5643
     
    6350# Include a Master Makefile with several cross-platform definitions and macros.
    6451# This is used to compensate for the differences between the target platforms.
    65 !include        ../INCLUDE/MAKEFILE.MIF
     52!include        ../include/makefile.mif
    6653
    6754# On my system, JWasm takes forever to generate a list-file when on a network
     
    6956# makes no difference. If you experience the same, then put a '#' in front of
    7057# the variable below to keep JWasm from generating a list-file.
    71 #JWASM_LIST_FILE=-Fl=$^&.LST
     58JWASM_LIST_FILE=-Fl=$^&.lst
    7259
    7360# Specifies the level of debugging.
     
    9279# The various language versions are created by replacing TXT-files
    9380# and reassembling this file.
    94 BASENAME=AIR-BOOT
     81BASENAME=air-boot
    9582
    9683# When you are developing, you might want to do that using your own language.
    97 # Using 'wmake dev' will built a module called AIRBOOT.BIN with this language
     84# Using 'wmake dev' will built a module called 'airboot.bin' with this language
    9885# and leave all the intermediate files intact.
    9986# When developing on a non-RU language version, you need to do a 'wmake RU'
     
    10289# taking up extra space. If it builds for RU it will build for all other
    10390# languages.
    104 DEV_BLD_LANG=EN
     91DEV_BLD_LANG=en
    10592
    10693# These are the languages that AiR-BOOT can be assembled with.
     
    11097# will run out-of-space sooner that the other languages.
    11198# If that happens at least the others will be built.
    112 BLD_LANGUAGES=EN DE NL FR IT SW RU
    113 #BLD_LANGUAGES=EN DE NL
     99BLD_LANGUAGES=en de nl fr it sw ru
     100#BLD_LANGUAGES=en de nl
    114101
    115102# For each language the Assembler source is compiled to a binary image
     
    118105# When developing the final image is not renamed.
    119106# Note that it differs from the source basename.
    120 MODULE=AIRBOOT
     107MODULE=airboot
    121108
    122109# This is a list of the Targets to be built.
    123 # For AiR-BOOT there is only one real target: AIRBOOT.BIN.
     110# For AiR-BOOT there is only one real target: 'airboot.bin'.
    124111# Each language build generates this target and it is later renamed.
    125112# Only a dev-build does not rename it so it can directly be used by
    126113# the installer.
    127 TARGET=$(MODULE).BIN
     114TARGET=$(MODULE).bin
    128115
    129116#~ %AB_DEV=FALSE
     
    181168# -Zd   = line number debug info
    182169# -Zi   = symbolic debug info
    183 ASM_FLAGS_D0=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -W0 -Cp -zcw -Fo$^. -Sa $(JWASM_LIST_FILE) -Fw$^&.ERR
    184 ASM_FLAGS_D1=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -W4 -Cp -zcw -Zd -Zi -Fo$^. -Sa $(JWASM_LIST_FILE) -Fw$^&.ERR
    185 ASM_FLAGS_D2=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -W4 -Cp -zcw -Zd -Zi -Fo$^. -Sa $(JWASM_LIST_FILE) -Fw$^&.ERR
     170ASM_FLAGS_D0=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -W0 -Cp -zcw -Fo$^. -Sa $(JWASM_LIST_FILE) -Fw$^&.err
     171ASM_FLAGS_D1=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -W4 -Cp -zcw -Zd -Zi -Fo$^. -Sa $(JWASM_LIST_FILE) -Fw$^&.err
     172ASM_FLAGS_D2=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -W4 -Cp -zcw -Zd -Zi -Fo$^. -Sa $(JWASM_LIST_FILE) -Fw$^&.err
    186173
    187174# WASM
    188175!elseif "$(ASM)"=="wasm"
    189176# -w0   = suppress warnings (wasm is nice to check for missing size qualifiers)
    190 ASM_FLAGS_D0=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dWASM -zq -w4 -fo=$^. -fr=$^&.ERR
    191 ASM_FLAGS_D1=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dWASM -zq -w4 -d1 -fo=$^. -fr=$^&.ERR
    192 ASM_FLAGS_D2=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dWASM -zq -w4 -d1 -fo=$^. -fr=$^&.ERR
     177ASM_FLAGS_D0=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dWASM -zq -w4 -fo=$^. -fr=$^&.err
     178ASM_FLAGS_D1=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dWASM -zq -w4 -d1 -fo=$^. -fr=$^&.err
     179ASM_FLAGS_D2=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dWASM -zq -w4 -d1 -fo=$^. -fr=$^&.err
    193180
    194181# TASM
     
    201188# MASM
    202189!elseif "$(ASM)"=="masm"
    203 ASM_FLAGS_D0=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DMASM -c -nologo -Cp -Fo$^. -Sa -Fl$^&.LST
    204 ASM_FLAGS_D1=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DMASM -c -nologo -Cp -Zd -Zi -Fo$^. -Sa -Fl$^&.LST
    205 ASM_FLAGS_D2=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DMASM -c -nologo -Cp -Zd -Zi -Fo$^. -Sa -Fl$^&.LST
     190ASM_FLAGS_D0=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DMASM -c -nologo -Cp -Fo$^. -Sa -Fl$^&.lst
     191ASM_FLAGS_D1=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DMASM -c -nologo -Cp -Zd -Zi -Fo$^. -Sa -Fl$^&.lst
     192ASM_FLAGS_D2=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DMASM -c -nologo -Cp -Zd -Zi -Fo$^. -Sa -Fl$^&.lst
    206193
    207194# ALP -- Does not support '/' for includes so it cannot be used for now.
    208195!elseif "$(ASM)"=="alp"
    209 ASM_FLAGS_D0=-D:DEBUG_LEVEL=$(DEBUG_LEVEL) -D:ALP -Mb +Feo:OBJ +Fl +Fel:LST +Fm +Fem:ERR
    210 ASM_FLAGS_D1=-D:DEBUG_LEVEL=$(DEBUG_LEVEL) -D:ALP -Mb +Od:MS16 +Feo:OBJ +Fl +Fel:LST +Fm +Fem:ERR
     196ASM_FLAGS_D0=-D:DEBUG_LEVEL=$(DEBUG_LEVEL) -D:ALP -Mb +Feo:obj +Fl +Fel:LST +Fm +Fem:err
     197ASM_FLAGS_D1=-D:DEBUG_LEVEL=$(DEBUG_LEVEL) -D:ALP -Mb +Od:MS16 +Feo:obj +Fl +Fel:lst +Fm +Fem:err
    211198ASM_FLAGS_D2=-D:DEBUG_LEVEL=$(DEBUG_LEVEL) -D:ALP
    212199
     
    245232# Open Watcom Linker.
    246233LNK=wlink
    247 LNK_FLAGS_D0=op q op v disa {1014 1023} op map=$^&.MAP
    248 LNK_FLAGS_D1=op q op v d all op map=$^&.MAP
    249 LNK_FLAGS_D2=op q op v d all op map=$^&.MAP
     234LNK_FLAGS_D0=op q op v disa {1014 1023} op map=$^&.map
     235LNK_FLAGS_D1=op q op v d all op map=$^&.map
     236LNK_FLAGS_D2=op q op v d all op map=$^&.map
    250237LNK_FLAGS=$(LNK_FLAGS_D$(DEBUG_LEVEL))
    251238
    252239# These need to be built
    253 DEPTARGETS=MBR-PROT ..$(DS)TOOLS$(DS)INTERNAL
     240DEPTARGETS=mbr-prot ..$(DS)tools$(DS)internal
    254241
    255242
     
    318305# Note that this target is not used as a 'dependency' but 'called' explicitly
    319306# by the $(BLD_LANGUAGES) target.
    320         @echo Include TEXT/$(%BLD_LANG)/MBR.ASM                 > TEXT$(DS)TXTMBR.ASM
    321         @echo Include TEXT/$(%BLD_LANG)/MENUS.ASM               > TEXT$(DS)TXTMENUS.ASM
    322         @echo Include TEXT/$(%BLD_LANG)/OTHER.ASM               > TEXT$(DS)TXTOTHER.ASM
     307        @echo include text/$(%BLD_LANG)/mbr.asm                 > text$(DS)txtmbr.asm
     308        @echo include text/$(%BLD_LANG)/menus.asm               > text$(DS)txtmenus.asm
     309        @echo include text/$(%BLD_LANG)/other.asm               > text$(DS)txtother.asm
    323310
    324311
     
    347334        @echo.
    348335        @echo   ** Renaming Target **
    349         $(MV) $(TARGET) AIRBT-$@.BIN
     336        $(MV) $(TARGET) airbt-$@.bin
    350337!endif
    351338#       @echo $(%AB_DEV)
     
    432419#
    433420# This builds the MBR Protection Image.
    434 # It will be embedded into the final AiR-BOOT binary. (AIRBOOT.BIN)
     421# It will be embedded into the final AiR-BOOT binary. (airboot.bin)
    435422#
    436423mbrprot:        .symbolic
     
    438425        @echo @ Building MBR Protection Image and FixCode first @
    439426        @echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    440         cd MBR-PROT
     427        cd mbr-prot
    441428        $(MAKE) -h
    442429        cd ..
     
    448435#
    449436fixcode:        .procedure
    450         cd ..$(DS)TOOLS$(DS)INTERNAL
     437        cd ..$(DS)tools$(DS)internal
    451438        $(MAKE) -h
    452         cd ..$(DS)..$(DS)BOOTCODE
     439        cd ..$(DS)..$(DS)bootcode
    453440
    454441
     
    458445
    459446# -----------------------------------------------------------------------------
    460 # FINAL AIRBOOT.BIN IMAGE
     447# FINAL 'airboot.bin' IMAGE
    461448# -----------------------------------------------------------------------------
    462449# This is the final AiR-BOOT image and has been built for the language
     
    467454# with NDISASM for cross reference.
    468455# -----------------------------------------------------------------------------
    469 $(TARGET):      .MULTIPLE Makefile.bu $(BASENAME).COM
     456$(TARGET):      .MULTIPLE Makefile.bu $(BASENAME).com
    470457        @echo $^.:      [Final 16-bits raw Binary Image]
    471458!ifdef  __MSDOS__
    472         ..$(DS)TOOLS$(DS)INTERNAL$(DS)FIXCODED.EXE
     459        ..$(DS)tools$(DS)internal$(DS)fixcoded.exe
    473460!endif
    474461!ifdef  __OS2__
    475         ..$(DS)TOOLS$(DS)INTERNAL$(DS)FIXCODE2.EXE
     462        ..$(DS)tools$(DS)internal$(DS)fixcode2.exe
    476463!endif
    477464!ifdef  __NT__
    478         ..$(DS)TOOLS$(DS)INTERNAL$(DS)FIXCODEW.EXE
     465        ..$(DS)tools$(DS)internal$(DS)fixcodew.exe
    479466!endif
    480467!ifdef  __LINUX__
    481 #       ..$(DS)TOOLS$(DS)INTERNAL$(DS)FIXCODE
    482         @chmod +x ..$(DS)TOOLS$(DS)INTERNAL$(DS)FIXCODEL.ELF
    483         ..$(DS)TOOLS$(DS)INTERNAL$(DS)FIXCODEL.ELF
     468#       ..$(DS)tools$(DS)internal$(DS)fixcode
     469        @chmod +x ..$(DS)tools$(DS)internal$(DS)fixcodel.elf
     470        ..$(DS)tools$(DS)internal$(DS)fixcodel.elf
    484471        @chmod +x $^.
    485472!endif
    486473        @echo.
    487474!ifndef __MSDOS__
    488         ndisasm $(BASENAME).COM > $(BASENAME).COM.NDA
    489         ndisasm $(TARGET) > $(TARGET).NDA
     475        ndisasm $(BASENAME).com > $(BASENAME).com.nda
     476        ndisasm $(TARGET) > $(TARGET).nda
    490477!endif
    491478        @echo.
     
    494481
    495482# -----------------------------------------------------------------------------
    496 # INTERMEDIATE AIR-BOOT.COM IMAGE
     483# INTERMEDIATE 'air-boot.com' IMAGE
    497484# -----------------------------------------------------------------------------
    498485# This is an intermediate image without embedded MBR-protection and code count.
    499 # It needs to be post-processed with FIXBOOT.
     486# It needs to be post-processed with 'fixboot'.
    500487#
    501488# While both DOS COM and RAW linkage generate a flat 16-bits image with
     
    504491# So we use DOS COM linkage to proteced us from overflow incorrect fixups.
    505492# -----------------------------------------------------------------------------
    506 $(BASENAME).COM:        .MULTIPLE $(BASENAME).OBJ
     493$(BASENAME).com:        .MULTIPLE $(BASENAME).obj
    507494        @echo $^.:      [16-bits non-100h Intermediate Image]
    508         $(LNK) $(LNK_FLAGS) file $^&.OBJ name $^. sys dos com
    509 #       $(LNK) $(LNK_FLAGS) file $^&.OBJ name $^. form raw
    510 
    511 
    512 # -----------------------------------------------------------------------------
    513 # INTERMEDIATE AIR-BOOT.OBJ OBJECT MODULE
    514 # -----------------------------------------------------------------------------
    515 # This is the result of assembling AIR-BOOT.ASM.
    516 # It is assembled back twice with WDIS for cross reference.
     495        $(LNK) $(LNK_FLAGS) file $^&.obj name $^. sys dos com
     496#       $(LNK) $(LNK_FLAGS) file $^&.obj name $^. form raw
     497
     498
     499# -----------------------------------------------------------------------------
     500# INTERMEDIATE 'air-boot.obj' OBJECT MODULE
     501# -----------------------------------------------------------------------------
     502# This is the result of assembling 'air-boot.asm'.
     503# It is assembled back twice with 'wdis' for cross reference.
    517504# - once as an (almost) assemblable source-file
    518505# - once as a disassembly with opcodes in it
    519506# -----------------------------------------------------------------------------
    520 $(BASENAME).OBJ:        .MULTIPLE $(BASENAME).ASM
     507$(BASENAME).obj:        .MULTIPLE $(BASENAME).asm
    521508        @echo $^.:      [16-bits OMF Object File]
    522         $(ASM) $(ASM_FLAGS) $(BASENAME).ASM
     509        $(ASM) $(ASM_FLAGS) $(BASENAME).asm
    523510!ifndef __MSDOS__
    524         @wdis -fi $^. > $^..WDA
    525 !endif
    526         @wdis -a -p -fi $^. > $^&.WDA
     511        @wdis -fi $^. > $^..wda
     512!endif
     513        @wdis -a -p -fi $^. > $^&.wda
    527514
    528515
     
    535522# DEVELOPER TARGET
    536523# -----------------------------------------------------------------------------
    537 # This meta-target builds an AIRBOOT.BIN module using the DEV_BLD_LANG setting.
    538 # It does not change the file-name to correspond to the language,
    539 # so it can directly be used by the installer.
     524# This meta-target builds an 'airboot.bin' module using the DEV_BLD_LANG
     525# setting. It does not change the file-name to correspond to the language,so
     526# it can directly be used by the installer.
    540527# This is the main target when developing.
    541528# -----------------------------------------------------------------------------
     
    555542        @bldlevel $(TARGET)
    556543        @echo.
    557         -@type AIRBOOT.MD5 2> nul
    558         @md5sum $(TARGET) > AIRBOOT.MD5
    559         @type AIRBOOT.MD5
     544        -@type airboot.md5 2> nul
     545        @md5sum $(TARGET) > airboot.md5
     546        @type airboot.md5
    560547!endif
    561548!ifdef  __LINUX__
    562549        @echo.
    563         @if exist AIR-BOOT.LST @grep ^zzz_code_space AIR-BOOT.LST
    564         @echo.
    565         @cat AIRBOOT.MD5
    566         @md5sum $(TARGET) > AIRBOOT.MD5
    567         @cat AIRBOOT.MD5
     550        @if exist air-boot.lst @grep ^zzz_code_space air-boot.lst
     551        @echo.
     552        @cat airboot.md5
     553        @md5sum $(TARGET) > airboot.md5
     554        @cat airboot.md5
    568555        @echo.
    569556!endif
     
    583570#       @echo CLEANING UP
    584571        @for %%i in ($(TARGET)) do @if exist %%i $(RM) %%i
    585         @if exist *.COM $(RM) *.COM
    586         @if exist *.COM $(RM) *.EXE
    587         @if exist *.OBJ $(RM) *.OBJ
    588         @if exist *.WDA $(RM) *.WDA
    589         @if exist *.NDA $(RM) *.NDA
    590         @if exist *.MAP $(RM) *.MAP
    591         @if exist *.LST $(RM) *.LST
    592         @if exist *.ERR $(RM) *.ERR
     572        @if exist *.com $(RM) *.com
     573        @if exist *.com $(RM) *.exe
     574        @if exist *.obj $(RM) *.obj
     575        @if exist *.wda $(RM) *.wda
     576        @if exist *.nda $(RM) *.nda
     577        @if exist *.map $(RM) *.map
     578        @if exist *.lst $(RM) *.lst
     579        @if exist *.err $(RM) *.err
    593580        @if exist *.o   $(RM) *.o
    594581        @%MAKE rmbin
    595582
    596583# -----------------------------------------------------------------------------
    597 # REMOVE ALL RESIDUAL .BIN FILES (old builds)
     584# REMOVE ALL RESIDUAL .bin FILES (old builds)
    598585# -----------------------------------------------------------------------------
    599586rmbin:  .SYMBOLIC
    600         @if exist *.BIN $(RM) *.BIN
     587        @if exist *.bin $(RM) *.bin
    601588
    602589
     
    604591# DISTRIBUTE TO RELEASE SPACE
    605592# -----------------------------------------------------------------------------
    606 # This distributes all .BIN files to BOOTCODE.
    607 # Then it installs the English version to RELEASES as AIRBOOT.BIN.
     593# This distributes all .bin files to bootcode.
     594# Then it installs the English version to 'release' as 'airboot.bin'.
    608595# -----------------------------------------------------------------------------
    609596dist:   .SYMBOLIC
    610         @if exist *.BIN $(CP) *.BIN ..$(DS)RELEASE$(DS)BOOTCODE
    611         @if exist AIRBT-EN.BIN $(CP) AIRBT-EN.BIN ..$(DS)RELEASE$(DS)DOS$(DS)$(TARGET)
    612         @if exist AIRBT-EN.BIN $(CP) AIRBT-EN.BIN ..$(DS)RELEASE$(DS)WINNT$(DS)$(TARGET)
    613         @if exist AIRBT-EN.BIN $(CP) AIRBT-EN.BIN ..$(DS)RELEASE$(DS)OS2$(DS)$(TARGET)
    614         @if exist AIRBT-EN.BIN $(CP) AIRBT-EN.BIN ..$(DS)RELEASE$(DS)LINUX$(DS)$(TARGET)
     597        @if exist *.bin $(CP) *.bin ..$(DS)release$(DS)bootcode
     598        @if exist airbt-en.bin $(CP) airbt-en.bin ..$(DS)release$(DS)dos$(DS)$(TARGET)
     599        @if exist airbt-en.bin $(CP) airbt-en.bin ..$(DS)release$(DS)winnt$(DS)$(TARGET)
     600        @if exist airbt-en.bin $(CP) airbt-en.bin ..$(DS)release$(DS)os2$(DS)$(TARGET)
     601        @if exist airbt-en.bin $(CP) airbt-en.bin ..$(DS)release$(DS)linux$(DS)$(TARGET)
    615602
    616603
     
    626613        @echo           wmake list      to show the list of buildable targets
    627614        @echo           wmake clean     to remove almost all generated files
    628         @echo           wmake rmbin     to remove all residual BIN files
     615        @echo           wmake rmbin     to remove all residual 'bin' files
    629616        @echo           wmake rebuild   to rebuild all targets
    630617        @echo           wmake dist      to populate the dist directories
Note: See TracChangeset for help on using the changeset viewer.