Changeset 63 for trunk/bootcode/Makefile


Ignore:
Timestamp:
Oct 9, 2016, 10:53:41 PM (9 years ago)
Author:
Ben Rietbroek
Message:

Updated Build Info and added File Commander Build Menus [v1.1.1-testing]

CAUTION:
This is a testbuild !
AirBoot uses the BIOS to access disks and a small coding error can trash
partition tables or other vital disk structures. You are advised to make
backups of TRACK0 and EBRs before using this testbuild. More info at:
https://rousseaux.github.io/netlabs.air-boot/pdf/AirBoot-v1.1.0-manual.pdf

Changes:
o Updated Build Info
o Added simple File Commander Build Menus
o Removed tabs from non-recipe sections in Makefiles

Notes:
o RU version currently does not build due to lack of code-space

Will be resolved when FX-code is removed from build.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bootcode/Makefile

    r60 r63  
    11###############################################################################
    2 # Makefile :: Builds the 'airboot.bin' 16-bits RAW Loader Image               #
     2# Makefile :: Builds the 'airboot.bin' 16-bits RAW Loader Image       (WMake) #
     3# --------------------------------------------------------------------------- #
     4#                                                                             #
     5# This Makefile builds the 'airboot.bin' program.                             #
     6# This is the actual AiR-BOOT that you see when starting your system.         #
     7# It operates at the BIOS level and thus without any operating-system         #
     8# being active. It's first 512 bytes get loaded by the BIOS at address        #
     9# 0000:7C00 and then control is transferred. This first 512 bytes constitute  #
     10# the AiR-BOOT MBR-code, and this code loads the rest of the AiR-BOOT image.  #
     11#                                                                             #
     12# AiR-BOOT, as designed by Martin Kiewitz, boosts a lot of powerful features  #
     13# in a tiny space (just over 31kB). One of this features is detecting         #
     14# possible virusses. This detection code is "hooked" into the interrupt-chain #
     15# and therefore has it's own relocations which are not related to the main    #
     16# loader image. For this reason, when the main source 'air-boot.asm' is       #
     17# assembled to a RAW image, this virus-protection code is "embedded" as the   #
     18# last step. You could compare this to binding a resource-file to an OS/2     #
     19# executable.                                                                 #
     20#                                                                             #
     21# When AiR-BOOT gets control, this virus-protection code is copied elsewhere  #
     22# and hooked into the interrupt-system. So it functions kinda like a DOS TSR. #
     23#                                                                             #
     24# This embedding proccess consists of three parts:                            #
     25# - Assembling the virus-detection code, 'mbrprot.asm', which always results  #
     26#   in a 1024 bytes image.                                                    #
     27# - Compiling the 'fixcode' program that does the actual embedding.           #
     28# - Running the 'fixcode' program against 'air-boot.com' creating the         #
     29#       final 'airboot.bin' image.                                                #
     30#                                                                             #
     31# After these operations have been completed, the 'airboot.bin' image         #
     32# is ready to be installed.                                                   #
     33#                                                                             #
    334###############################################################################
    4 # rousseau@ecomstation.com
    5 
    6 #
    7 # This Makefile builds the 'airboot.bin' program.
    8 # This is the actual AiR-BOOT that you see when starting your system.
    9 # It operates at the BIOS level and thus without any operating-system
    10 # being active. It's first 512 bytes get loaded by the BIOS at address
    11 # 0000:7C00 and then control is transferred. This first 512 bytes constitute
    12 # the AiR-BOOT MBR-code, and this code loads the rest of the AiR-BOOT image.
    13 #
    14 
    15 #
    16 # AiR-BOOT, as designed by Martin Kiewitz, boosts a lot of powerful features
    17 # in a tiny space (just over 31kB). One of this features is detecting
    18 # possible virusses. This detection code is "hooked" into the interrupt-chain
    19 # and therefore has it's own relocations which are not related to the main
    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.
    24 #
    25 # When AiR-BOOT gets control, this virus-protection code is copied elsewhere
    26 # and hooked into the interrupt-system. So it functions kinda like a DOS TSR.
    27 #
    28 
    29 #
    30 # This embedding proccess consists of three parts:
    31 # - Assembling the virus-detection code, 'mbrprot.asm', which always results
    32 #   in a 1024 bytes 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
    40 # is ready to be installed.
    41 #
    42 
    43 
    44 
    45 
    46 #                                                       DEFINITIONS AND STUFF
     35
     36
     37
     38#                           DEFINITIONS AND STUFF
    4739# _____________________________________________________________________________
    4840
     
    5042# Include a Master Makefile with several cross-platform definitions and macros.
    5143# This is used to compensate for the differences between the target platforms.
    52 !include        ../include/makefile.mif
     44!include ../include/makefile.mif
    5345
    5446# On my system, JWasm takes forever to generate a list-file when on a network
     
    5648# makes no difference. If you experience the same, then put a '#' in front of
    5749# the variable below to keep JWasm from generating a list-file.
    58 JWASM_LIST_FILE=-Fl=$^&.lst
     50#~ JWASM_LIST_FILE=-Fl=$^&.lst
    5951
    6052# Specifies the level of debugging.
     
    136128
    137129# If no assembler is specified then default to JWasm.
    138 !ifndef ASM
     130!ifndef ASM
    139131ASM=jwasm
    140132!endif
     
    144136# set the XMS memory limit to 0.
    145137# JWasmR will probably run out of memory and cannot be used.
    146 !ifdef  __MSDOS__
     138!ifdef __MSDOS__
    147139ASM=tasm
    148140!endif
     
    151143# So we override to jwasm when a non-jwasm assembler is specified and
    152144# we are building on Linux.
    153 !ifdef  __LINUX__
     145!ifdef __LINUX__
    154146!if "$(ASM)"=="masm" | "$(ASM)"=="tasm" | "$(ASM)"=="alp"
    155147ASM=jwasm
     
    163155# JWASM
    164156!if "$(ASM)"=="jwasm"
    165 # -Cp   = case sensitive symbols
    166 # -zcw  = no _ prefix on symbols (C model)
    167 # -Zm   = Masm51 compat -- don't use ! (Will generate incorrect offsets)
    168 # -Zd   = line number debug info
    169 # -Zi   = symbolic debug info
     157# -Cp   = case sensitive symbols
     158# -zcw  = no _ prefix on symbols (C model)
     159# -Zm   = Masm51 compat -- don't use ! (Will generate incorrect offsets)
     160# -Zd   = line number debug info
     161# -Zi   = symbolic debug info
    170162ASM_FLAGS_D0=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -W0 -Cp -zcw -Fo$^. -Sa $(JWASM_LIST_FILE) -Fw$^&.err
    171163ASM_FLAGS_D1=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -W4 -Cp -zcw -Zd -Zi -Fo$^. -Sa $(JWASM_LIST_FILE) -Fw$^&.err
    172164ASM_FLAGS_D2=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -W4 -Cp -zcw -Zd -Zi -Fo$^. -Sa $(JWASM_LIST_FILE) -Fw$^&.err
     165# Workaround for JWasm list-file generation.
     166# Generate the list-file on a local drive so JWasm doen't take forever.
     167# This is done in the recipe.
     168JWASM_LIST_FILE_LOC=$(%TEMP)\
     169JWASM_LIST_FILE=-Fl=$(JWASM_LIST_FILE_LOC)$^&.lst
    173170
    174171# WASM
    175172!elseif "$(ASM)"=="wasm"
    176 # -w0   = suppress warnings (wasm is nice to check for missing size qualifiers)
     173# -w0   = suppress warnings (wasm is nice to check for missing size qualifiers)
    177174ASM_FLAGS_D0=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dWASM -zq -w4 -fo=$^. -fr=$^&.err
    178175ASM_FLAGS_D1=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dWASM -zq -w4 -d1 -fo=$^. -fr=$^&.err
     
    181178# TASM
    182179!elseif "$(ASM)"=="tasm"
    183 # -ml   = case sensitive symbols
     180# -ml   = case sensitive symbols
    184181ASM_FLAGS_D0=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dTASM -t -ml -m9 -l
    185182ASM_FLAGS_D1=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dTASM -t -ml -m9 -z -zi -c -la
     
    242239
    243240
    244 #                                                       BEFORE AND AFTER TARGETS
     241#                           BEFORE AND AFTER TARGETS
    245242# _____________________________________________________________________________
    246243
     
    257254# -----------------------------------------------------------------------------
    258255.AFTER
    259 #       @echo == AFTER ==
    260 !ifdef  __MSDOS__
     256# @echo == AFTER ==
     257!ifdef __MSDOS__
    261258        @echo $(WARN_DOS_BLD_ENV)
    262259!endif
     
    268265
    269266
    270 #                                               PSEUDO TARGETS FOR PREPARATION
     267#                       PSEUDO TARGETS FOR PREPARATION
    271268# _____________________________________________________________________________
    272269
     
    281278# the intermediate files intact.
    282279# -----------------------------------------------------------------------------
    283 all:    .SYMBOLIC Makefile.bu $(BLD_LANGUAGES) footer
     280all: .SYMBOLIC Makefile.bu $(BLD_LANGUAGES) footer
    284281#       @echo ALL !!
    285282#       @#MAKE $(BLD_LANGUAGES)
     
    296293# This is a 'pre-action' before assembling the AiR-BOOT.ASM source.
    297294# -----------------------------------------------------------------------------
    298 langsetup:      .SYMBOLIC .MULTIPLE
     295langsetup: .SYMBOLIC .MULTIPLE
    299296# Default to development language is none defined.
    300297!if "$(%BLD_LANG)"==""
     
    305302# Note that this target is not used as a 'dependency' but 'called' explicitly
    306303# by the $(BLD_LANGUAGES) target.
    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
     304        @echo include text/$(%BLD_LANG)/mbr.asm text$(DS)txtmbr.asm
     305        @echo include text/$(%BLD_LANG)/menus.asm> text$(DS)txtmenus.asm
     306        @echo include text/$(%BLD_LANG)/other.asm> text$(DS)txtother.asm
    310307
    311308
     
    318315# depends on it.
    319316# -----------------------------------------------------------------------------
    320 $(BLD_LANGUAGES):       .SYMBOLIC
     317$(BLD_LANGUAGES): .SYMBOLIC
    321318        @SET BLD_LANG=$@
    322319        @%MAKE header
     
    330327#       @echo $(%AB_DEV)
    331328# Do not rename for dev-build
    332 !if     "$(%AB_DEV)"!="TRUE"
     329!if "$(%AB_DEV)"!="TRUE"
    333330#~ !ifndef %AB_DEV
    334331        @echo.
     
    353350# SHOW THE HEADER FOR THE TARGET BEING BUILT
    354351# -----------------------------------------------------------------------------
    355 header: .SYMBOLIC .MULTIPLE
     352header: .SYMBOLIC .MULTIPLE
    356353        @echo.
    357354        @echo =====================================================================
     
    364361# SHOW THE FOOTER
    365362# -----------------------------------------------------------------------------
    366 footer: .SYMBOLIC
     363footer: .SYMBOLIC
    367364#       $(RM) $(TARGET)
    368365        @echo All targets up to date !
     
    378375# using the new level.
    379376# -----------------------------------------------------------------------------
    380 Makefile.bu:    Makefile
     377Makefile.bu: Makefile
    381378        @echo.
    382379        @echo Makefile modified, forcing rebuild of all targets !
     
    421418# It will be embedded into the final AiR-BOOT binary. (airboot.bin)
    422419#
    423 mbrprot:        .symbolic
     420mbrprot: .symbolic
    424421        @echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    425422        @echo @ Building MBR Protection Image and FixCode first @
     
    434431# FixCode embeds the MBR Protection Image into the final AiR-BOOT binary.
    435432#
    436 fixcode:        .procedure
     433fixcode: .procedure
    437434        cd ..$(DS)tools$(DS)internal
    438435        $(MAKE) -h
    439436        cd ..$(DS)..$(DS)bootcode
    440437
    441 
    442 #                                                               MAIN TARGETS
     438#
     439# Installer installs the loader to disk
     440#
     441installer2: .procedure
     442        cd ..$(DS)install$(DS)c
     443        $(MAKE) -h airboot2.exe
     444        cd ..$(DS)..$(DS)bootcode
     445
     446#                               MAIN TARGETS
    443447# _____________________________________________________________________________
    444448
     
    454458# with NDISASM for cross reference.
    455459# -----------------------------------------------------------------------------
    456 $(TARGET):      .MULTIPLE Makefile.bu $(BASENAME).com
     460$(TARGET): .MULTIPLE Makefile.bu $(BASENAME).com
    457461        @echo $^.:      [Final 16-bits raw Binary Image]
    458 !ifdef  __MSDOS__
     462!ifdef __MSDOS__
    459463        ..$(DS)tools$(DS)internal$(DS)fixcoded.exe
    460464!endif
    461 !ifdef  __OS2__
     465!ifdef __OS2__
    462466        ..$(DS)tools$(DS)internal$(DS)fixcode2.exe
    463467!endif
    464 !ifdef  __NT__
     468!ifdef __NT__
    465469        ..$(DS)tools$(DS)internal$(DS)fixcodew.exe
    466470!endif
    467 !ifdef  __LINUX__
     471!ifdef __LINUX__
    468472#       ..$(DS)tools$(DS)internal$(DS)fixcode
    469473        @chmod +x ..$(DS)tools$(DS)internal$(DS)fixcodel.elf
     
    472476!endif
    473477        @echo.
    474 !ifndef __MSDOS__
     478!ifndef __MSDOS__
    475479        ndisasm $(BASENAME).com > $(BASENAME).com.nda
    476480        ndisasm $(TARGET) > $(TARGET).nda
    477481!endif
    478482        @echo.
    479         @if exist $^. @echo             ** $^. $(MSG_SUCCESS) - [$(%BLD_LANG) version] **
     483        @if exist $^. @echo ** $^. $(MSG_SUCCESS) - [$(%BLD_LANG) version] **
    480484
    481485
     
    491495# So we use DOS COM linkage to proteced us from overflow incorrect fixups.
    492496# -----------------------------------------------------------------------------
    493 $(BASENAME).com:        .MULTIPLE $(BASENAME).obj
    494         @echo $^.:      [16-bits non-100h Intermediate Image]
     497$(BASENAME).com: .MULTIPLE $(BASENAME).obj
     498        @echo $^.: [16-bits non-100h Intermediate Image]
    495499        $(LNK) $(LNK_FLAGS) file $^&.obj name $^. sys dos com
    496500#       $(LNK) $(LNK_FLAGS) file $^&.obj name $^. form raw
     
    505509# - once as a disassembly with opcodes in it
    506510# -----------------------------------------------------------------------------
    507 $(BASENAME).obj:        .MULTIPLE $(BASENAME).asm
    508         @echo $^.:      [16-bits OMF Object File]
     511$(BASENAME).obj: .MULTIPLE $(BASENAME).asm
     512        @echo $^.: [16-bits OMF Object File]
    509513        $(ASM) $(ASM_FLAGS) $(BASENAME).asm
    510 !ifndef __MSDOS__
     514!if "$(%AB_DEV)"=="TRUE"
     515        @copy ..\install\c\airboot2.exe .
     516!endif
     517!if "$(ASM)"=="jwasm"
     518# Workaround for generating JWasm list-files.
     519# Command 'move' does not work across drives.
     520# So we do a 'copy' then 'del' instead.
     521        @if not exist $^&.lst copy $(JWASM_LIST_FILE_LOC)$^&.lst .
     522        @if exist $(JWASM_LIST_FILE_LOC)$^&.lst del $(JWASM_LIST_FILE_LOC)$^&.lst
     523!endif
     524!ifndef __MSDOS__
    511525        @wdis -fi $^. > $^..wda
    512526!endif
     
    515529
    516530
    517 #                                                               MAIN ACTIONS
     531#                               MAIN ACTIONS
    518532# _____________________________________________________________________________
    519533
     
    527541# This is the main target when developing.
    528542# -----------------------------------------------------------------------------
    529 dev:    .SYMBOLIC
     543dev: .SYMBOLIC
    530544        @%MAKE rmbin
    531545        @%MAKE mbrprot
    532546        @%MAKE fixcode
     547        @%MAKE installer2
    533548        SET AB_DEV=TRUE
    534549#       @%MAKE $(DEV_BLD_LANG)
     
    538553        @$(MAKE) -h $(DEV_BLD_LANG)
    539554# Display the BLDLEVEL information if we are building on OS/2.
    540 !ifdef  __OS2__
     555!ifdef __OS2__
    541556        @echo.
    542557        @bldlevel $(TARGET)
     
    546561        @type airboot.md5
    547562!endif
    548 !ifdef  __LINUX__
     563!ifdef __LINUX__
    549564        @echo.
    550565        @if exist air-boot.lst @grep ^zzz_code_space air-boot.lst
     
    559574# REBUILD ALL TARGETS
    560575# -----------------------------------------------------------------------------
    561 rebuild:        .SYMBOLIC
     576rebuild: .SYMBOLIC
    562577        @%MAKE clean
    563578        @%MAKE all
     
    567582# CLEANUP (intermediate files)
    568583# -----------------------------------------------------------------------------
    569 clean:  .SYMBOLIC .MULTIPLE
     584clean: .SYMBOLIC .MULTIPLE
    570585#       @echo CLEANING UP
    571586        @for %%i in ($(TARGET)) do @if exist %%i $(RM) %%i
    572587        @if exist *.com $(RM) *.com
    573         @if exist *.com $(RM) *.exe
     588        @if exist *.exe $(RM) *.exe
    574589        @if exist *.obj $(RM) *.obj
    575590        @if exist *.wda $(RM) *.wda
     
    584599# REMOVE ALL RESIDUAL .bin FILES (old builds)
    585600# -----------------------------------------------------------------------------
    586 rmbin:  .SYMBOLIC
     601rmbin: .SYMBOLIC
    587602        @if exist *.bin $(RM) *.bin
    588603
     
    594609# Then it installs the English version to 'release' as 'airboot.bin'.
    595610# -----------------------------------------------------------------------------
    596 dist:   .SYMBOLIC
     611dist: .SYMBOLIC
    597612        @if exist *.bin $(CP) *.bin ..$(DS)release$(DS)bootcode
    598613        @if exist airbt-en.bin $(CP) airbt-en.bin ..$(DS)release$(DS)dos$(DS)$(TARGET)
     
    605620# SHOW HELP ON USING THIS MAKEFILE
    606621# -----------------------------------------------------------------------------
    607 help:   .SYMBOLIC
    608         @echo.
    609         @echo           The following actions are available:
    610         @echo           wmake           to build all targets and all languages
    611         @echo           wmake dev       to build a develoopment target
    612         @echo           wmake [LANG]    to build EN,DE,NL,FR,IT or RU versions
    613         @echo           wmake list      to show the list of buildable targets
    614         @echo           wmake clean     to remove almost all generated files
    615         @echo           wmake rmbin     to remove all residual 'bin' files
    616         @echo           wmake rebuild   to rebuild all targets
    617         @echo           wmake dist      to populate the dist directories
    618         @echo           wmake help      for this information
     622help: .SYMBOLIC
     623        @echo.
     624        @echo The following actions are available:
     625        @echo wmake         to build all targets and all languages
     626        @echo wmake dev     to build a develoopment target
     627        @echo wmake [LANG]  to build EN,DE,NL,FR,IT or RU versions
     628        @echo wmake list    to show the list of buildable targets
     629        @echo wmake clean   to remove almost all generated files
     630        @echo wmake rmbin   to remove all residual 'bin' files
     631        @echo wmake rebuild to rebuild all targets
     632        @echo wmake dist    to populate the dist directories
     633        @echo wmake help    to show this information
    619634        @echo.
    620635
     
    623638# SHOW LIST OF BUILDABLE TARGETS
    624639# -----------------------------------------------------------------------------
    625 show:   .SYMBOLIC
    626         @echo.
    627         @echo           The following [case sensitive] targets can be built:
     640show: .SYMBOLIC
     641        @echo.
     642        @echo The following [case sensitive] targets can be built:
    628643        @for %%i in ($(TARGET)) do @echo        %%i
    629644        @echo.
    630645# Alias for show
    631 list:   .SYMBOLIC
     646list: .SYMBOLIC
    632647        @%MAKE show
    633648
     
    638653.ERROR
    639654        @echo.
    640         @echo           Oops!
    641         @echo           Some error occured in this build session.
    642         @echo           If you see stuff about "positive count"
    643         @echo           you have a section overlap.
    644         @echo           Check the z_* values at the end of the list-file
    645         @echo           and look for a negative gap.
    646         @echo           Type 'wmake help' in the target dir for a list of actions.
     655        @echo Oops!
     656        @echo Some error occured in this build session.
     657        @echo If you see stuff about "positive count"
     658        @echo you have a section overlap.
     659        @echo Check the z_* values at the end of the list-file
     660        @echo and look for a negative gap.
     661        @echo Type 'wmake help' in the target dir for a list of actions.
    647662#       @%MAKE help
    648663        @echo.
    649664
    650 
    651 # -----------------------------------------------------------------------------
    652 # How the hell can we use more than one command in the for-loop ??
    653 # -----------------------------------------------------------------------------
    654 ttt:    .SYMBOLIC
    655 # This does not work...
    656 #       @for %%i in ($(BLD_LANGUAGES)) do %%i=X; $%WMAKE;
Note: See TracChangeset for help on using the changeset viewer.