# create directories that will remain empty AddDirectoryToHaikuImage home Desktop ; AddDirectoryToHaikuImage home config bin ; AddDirectoryToHaikuImage home config lib ; AddDirectoryToHaikuImage var log ; AddDirectoryToHaikuImage var tmp ; if $(TARGET_ARCH) = x86 { X86_ONLY = "" ; PPC_ONLY = ; } else if $(TARGET_ARCH) = ppc { X86_ONLY = ; PPC_ONLY = "" ; } if $(INCLUDE_GPL_ADDONS) = 1 { GPL_ONLY = "" ; } else { GPL_ONLY = ; } BEOS_BIN = addattr alert basename beep cat catattr chgrp chmod chop chown clear clockconfig cmp comm cp copyattr csplit cut date dd desklink df diff dirname driveinfo dstcheck du echo eject env error factor false fdinfo ffm find finddir fortune ftp funzip gawk $(X86_ONLY)gdb grep groups gzip head hey id ideinfo idestatus ifconfig iroster isvolume join keymap kill less lessecho lesskey link listarea listattr listdev listimage listport listres listsem ln locate logger logname ls lsindex makebootable md5sum mimeset mkdos mkdir mkindex modifiers mount mountvolume mv open pathchk ping play playfile playsound playwav ps pwd query quit renice rm rmattr rmindex rmdir roster route safemode screen_blanker sed settype setversion setvolume sh shutdown sleep sort split strace su sum sync sysinfo tail tar tee top touch tput traceroute translate true tty uname unmount unzip unzipsfx uptime version waitfor wc whoami xargs xres yes zdiff zforce zgrep zip zipcloak zipnote zipsplit zmore znew ; BEOS_APPS = Terminal Expander People ShowImage Clock Pulse ProcessController SoundRecorder Magnify DiskProbe AboutHaiku StyledEdit Installer Workspaces $(X86_ONLY)Cortex $(X86_ONLY)CortexAddOnHost MediaPlayer DeskCalc MidiPlayer Icon-O-Matic BeMail ; BEOS_PREFERENCES = Backgrounds DataTranslations E-mail FileTypes Fonts Media Menu Mouse Keyboard Keymap Printers Screen ScreenSaver Sounds Time VirtualMemory ; BEOS_DEMOS = BitmapDrawing Chart $(X86_ONLY)GLTeapot PictureTest Playground ; BEOS_SYSTEM_LIB = libbe.so $(HAIKU_LIBSTDC++) libmedia.so libtracker.so libtranslation.so libnetwork.so libdebug.so libbsd.so libmail.so libtextencoding.so libz.so libfreetype.so libpng.so libmidi.so libmidi2.so libdevice.so libgame.so libscreensaver.so libroot.so $(X86_ONLY)libGL.so libfluidsynth.so libqoca.so ; BEOS_SYSTEM_SERVERS = registrar debug_server syslog_daemon media_server net_server media_addon_server input_server app_server fake_app_server midi_server print_server ; BEOS_NETWORK_DEVICES = ethernet loopback ; BEOS_NETWORK_DATALINK_PROTOCOLS = ethernet_frame arp loopback_frame ; #BEOS_NETWORK_PPP = ipcp modem pap pppoe ; BEOS_NETWORK_PROTOCOLS = ipv4 tcp udp icmp ; BEOS_ADD_ONS_ACCELERANTS = $(X86_ONLY)radeon.accelerant $(X86_ONLY)nv.accelerant $(X86_ONLY)mga.accelerant $(X86_ONLY)nm.accelerant $(X86_ONLY)intel_extreme.accelerant vesa.accelerant ; BEOS_ADD_ONS_TRANSLATORS = BMPTranslator GIFTranslator JPEGTranslator JPEG2000Translator TIFFTranslator PNGTranslator PPMTranslator RTF-Translator SGITranslator STXTTranslator TGATranslator ; BEOS_ADD_ONS_MEDIA = mixer.media_addon hmulti_audio.media_addon tone_producer_demo.media_addon video_producer_demo.media_addon #legacy.media_addon ; BEOS_ADD_ONS_MEDIA_PLUGINS = $(GPL_ONLY)ac3_decoder aiff_reader au_reader $(X86_ONLY)avcodec avi_reader matroska mov_reader mp3_decoder mp3_reader mp4_reader musepack ogg raw_decoder speex # theora vorbis wav_reader ; BEOS_ADD_ONS_PRINT = Canon\ LIPS3\ Compatible Canon\ LIPS4\ Compatible PCL5\ Compatible PCL6\ Compatible PDF\ Writer PS\ Compatible Preview ; BEOS_ADD_ONS_PRINT_TRANSPORT = HP\ JetDirect IPP LPR Parallel\ Port Print\ To\ File Serial\ Port USB\ Port ; BEOS_ADD_ONS_SCREENSAVERS = Haiku IFS ; BEOS_ADD_ONS_DRIVERS_AUDIO = auich auvia emuxki ; BEOS_ADD_ONS_DRIVERS_GRAPHICS = $(X86_ONLY)radeon.driver $(X86_ONLY)nv.driver $(X86_ONLY)nm.driver $(X86_ONLY)mga.driver $(X86_ONLY)intel_extreme vesa ; BEOS_ADD_ONS_DRIVERS_MIDI = emuxki ; BEOS_ADD_ONS_DRIVERS_NET = etherpci ipro1000 rtl8139 rtl8169 sis900 etherpci via-rhine wb840 net_stack $(GPL_ONLY)bcm440x $(GPL_ONLY)bcm570x ; BEOS_ADD_ONS_DRIVERS_ACPI = $(X86_ONLY)acpi_button $(X86_ONLY)acpi_ns_dump ; BEOS_ADD_ONS_BUS_MANAGERS = pci $(X86_ONLY)ps2 $(X86_ONLY)isa ide scsi config_manager $(X86_ONLY)acpi $(X86_ONLY)agp usb ; BEOS_ADD_ONS_FILESYSTEMS = bfs dos iso9660 ; # modules AddFilesToHaikuImage beos system add-ons kernel bus_managers : $(BEOS_ADD_ONS_BUS_MANAGERS) ; AddFilesToHaikuImage beos system add-ons kernel busses ide : generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 ; AddFilesToHaikuImage beos system add-ons kernel busses usb : uhci ohci ; AddFilesToHaikuImage beos system add-ons kernel console : vga_text ; AddFilesToHaikuImage beos system add-ons kernel file_systems : $(BEOS_ADD_ONS_FILESYSTEMS) ; AddFilesToHaikuImage beos system add-ons kernel generic : block_io fast_log ide_adapter locked_pool mpu401 scsi_periph ; AddFilesToHaikuImage beos system add-ons kernel partitioning_systems : intel session ; AddFilesToHaikuImage beos system add-ons kernel interrupt_controllers : $(PPC_ONLY)openpic ; if $(TARGET_ARCH) = x86 { AddFilesToHaikuImage beos system add-ons kernel cpu : generic_x86 ; } # drivers AddDriversToHaikuImage : console dprintf $(X86_ONLY)keyboard null random tty zero ; AddDriversToHaikuImage audio hmulti : $(BEOS_ADD_ONS_DRIVERS_AUDIO) ; AddDriversToHaikuImage midi : $(BEOS_ADD_ONS_DRIVERS_MIDI) ; AddDriversToHaikuImage bus : usb_raw ; AddDriversToHaikuImage disk scsi : scsi_cd scsi_dsk ; AddDriversToHaikuImage graphics : $(BEOS_ADD_ONS_DRIVERS_GRAPHICS) ; AddDriversToHaikuImage input : ps2_hid usb_hid ; AddDriversToHaikuImage misc : config poke ; AddDriversToHaikuImage net : $(BEOS_ADD_ONS_DRIVERS_NET) ; AddDriversToHaikuImage power : $(BEOS_ADD_ONS_DRIVERS_ACPI) ; # kernel AddFilesToHaikuImage beos system : kernel_$(TARGET_ARCH) ; # libs AddFilesToHaikuImage beos system lib : $(BEOS_SYSTEM_LIB) ; # libnetwork.so replaces quite a few libraries AddSymlinkToHaikuImage beos system lib : libnetwork.so : libsocket.so ; AddSymlinkToHaikuImage beos system lib : libnetwork.so : libbind.so ; AddSymlinkToHaikuImage beos system lib : libnetwork.so : libnet.so ; AddSymlinkToHaikuImage beos system lib : libnetwork.so : libnetapi.so ; AddSymlinkToHaikuImage beos system lib : libnetwork.so : libbnetapi.so ; # servers AddFilesToHaikuImage beos system servers : $(BEOS_SYSTEM_SERVERS) ; # apps AddFilesToHaikuImage beos system : runtime_loader Deskbar Tracker ; AddFilesToHaikuImage beos bin : $(BEOS_BIN) consoled ; AddFilesToHaikuImage beos apps : $(BEOS_APPS) ; AddFilesToHaikuImage beos preferences : $(BEOS_PREFERENCES) ; AddFilesToHaikuImage beos demos : $(BEOS_DEMOS) ; AddSymlinkToHaikuImage home Desktop : /boot/home : Home ; AddSymlinkToHaikuImage home config be : /boot/beos/apps : Applications ; AddSymlinkToHaikuImage home config be : /boot/beos/preferences : Preferences ; AddSymlinkToHaikuImage home config be : /boot/beos/demos : Demos ; AddSymlinkToHaikuImage beos bin : less : more ; AddSymlinkToHaikuImage beos bin : gzip : gunzip ; AddSymlinkToHaikuImage beos bin : gzip : zcat ; AddSymlinkToHaikuImage beos bin : zdiff : zcmp ; AddSymlinkToHaikuImage beos bin : unzip : zipinfo ; # scripts and data files local bootScripts = Bootscript SetupEnvironment Netscript InstallerInitScript InstallerFinishScript ; SEARCH on $(bootScripts) = [ FDirName $(HAIKU_TOP) data system boot ] ; AddFilesToHaikuImage beos system boot : $(bootScripts) ; local logoArtwork = "HAIKU logo - white on blue - big.png" "HAIKU logo - white on blue - small.png" ; SEARCH on $(logoArtwork) = [ FDirName $(HAIKU_TOP) data artwork ] ; AddFilesToHaikuImage beos etc artwork : $(logoArtwork) ; local svgFiles = "lion.svg" ; SEARCH on $(svgFiles) = [ FDirName $(HAIKU_TOP) src tests kits interface picture ] ; AddFilesToHaikuImage beos etc artwork : $(svgFiles) ; # TODO: Use data/etc/termcap or src/libs/termcap.src? local etcFiles = fortunes profile termcap teapot.data ; etcFiles = $(etcFiles:G=etc) ; SEARCH on $(etcFiles) = [ FDirName $(HAIKU_TOP) data etc ] ; AddFilesToHaikuImage beos etc : $(etcFiles) ; local fontDir = [ FDirName $(HAIKU_TOP) data etc fonts ] ; local psFonts = [ Glob $(fontDir)/psfonts : *.afm *.pfb ] ; local ttFonts = [ Glob $(fontDir)/ttfonts : *.ttf ] ; AddFilesToHaikuImage beos etc fonts psfonts : $(psFonts) ; AddFilesToHaikuImage beos etc fonts ttfonts : $(ttFonts) ; local kanbeDir = [ FDirName $(HAIKU_TOP) data etc KanBe ] ; local kanbeDefault = [ Glob $(kanbeDir)/default : *.canna *.gz ] ; local kanbeDic = [ Glob $(kanbeDir)/dic : *.cbp ] ; local kanbeDicCanna = [ Glob $(kanbeDir)/dic/canna : *.cld *.ctd *.cbd *.dir ] ; AddFilesToHaikuImage beos etc KanBe default : $(kanbeDefault) ; AddFilesToHaikuImage beos etc KanBe dic : $(kanbeDic) ; AddFilesToHaikuImage beos etc KanBe dic canna : $(kanbeDicCanna) ; AddDirectoryToHaikuImage beos etc KanBe dic group ; AddDirectoryToHaikuImage beos etc KanBe dic user ; #local libnetFiles = networks protocols resolv.conf services ; #libnetFiles = $(libnetFiles:G=libnet-files) ; #SEARCH on $(libnetFiles) # = [ FDirName $(HAIKU_TOP) src kits network compat libnet ] ; #AddFilesToHaikuImage beos etc : $(libnetFiles) ; local keymapFiles = [ GLOB [ FDirName $(HAIKU_TOP) src data etc keymaps ] : *.keymap ] ; keymapFiles = $(keymapFiles:BG=keymap) ; AddFilesToHaikuImage beos etc Keymap : $(keymapFiles) ; local timezones = [ FTimeZoneBinaries $(HAIKU_TIME_ZONE_SOURCES) : : true ] ; for timezone in $(timezones) { local dir = [ on $(timezone) return $(RELATIVE_TIMEZONE_DIR) ] ; AddFilesToHaikuImage beos etc timezones $(dir) : $(timezone) ; } local driverSettingsFiles = kernel ; SEARCH on $(driverSettingsFiles) = [ FDirName $(HAIKU_TOP) data settings kernel drivers ] ; AddFilesToHaikuImage home config settings kernel drivers : $(driverSettingsFiles) ; AddSymlinkToHaikuImage home config settings : /boot/beos/etc/timezones/Europe/Paris : timezone ; AddFilesToHaikuImage home config settings : US-International : Key_map ; # boot loader AddFilesToHaikuImage beos system : zbeos ; # boot module links AddBootModuleSymlinks config_manager bfs block_io fast_log generic_ide_pci $(X86_ONLY)isa ide ide_adapter $(X86_ONLY)ide_isa intel locked_pool $(PPC_ONLY)openpic pci scsi scsi_cd scsi_dsk scsi_periph silicon_image_3112 ; # add-ons AddFilesToHaikuImage beos system add-ons accelerants : $(BEOS_ADD_ONS_ACCELERANTS) ; AddFilesToHaikuImage beos system add-ons opengl : mesa_soft ; AddFilesToHaikuImage beos system add-ons Translators : $(BEOS_ADD_ONS_TRANSLATORS) ; AddFilesToHaikuImage beos system add-ons media : $(BEOS_ADD_ONS_MEDIA) ; AddFilesToHaikuImage beos system add-ons media plugins : $(BEOS_ADD_ONS_MEDIA_PLUGINS) ; AddFilesToHaikuImage beos system add-ons Tracker : FileType-F ZipOMatic-Z ; AddSymlinkToHaikuImage beos system add-ons Tracker : /boot/beos/preferences/Backgrounds : Background-B ; AddFilesToHaikuImage beos system add-ons input_server devices : keyboard mouse ; AddFilesToHaikuImage beos system add-ons input_server filters : screen_saver ; AddFilesToHaikuImage beos system add-ons kernel network : stack ; AddFilesToHaikuImage beos system add-ons kernel network devices : $(BEOS_NETWORK_DEVICES) ; AddFilesToHaikuImage beos system add-ons kernel network datalink_protocols : $(BEOS_NETWORK_DATALINK_PROTOCOLS) ; AddFilesToHaikuImage beos system add-ons kernel network ppp : $(BEOS_NETWORK_PPP) ; AddFilesToHaikuImage beos system add-ons kernel network protocols : $(BEOS_NETWORK_PROTOCOLS) ; AddFilesToHaikuImage beos system add-ons Print : $(BEOS_ADD_ONS_PRINT) ; AddFilesToHaikuImage beos system add-ons Print transport : $(BEOS_ADD_ONS_PRINT_TRANSPORT) ; AddFilesToHaikuImage beos system add-ons Screen\ Savers : $(BEOS_ADD_ONS_SCREENSAVERS) ; AddDirectoryToHaikuImage home config add-ons Tracker ; AddDirectoryToHaikuImage home config add-ons Screen\ Savers ; AddDirectoryToHaikuImage home config add-ons Translators ; AddDirectoryToHaikuImage beos etc synth ; #optional AddFilesToHaikuImage optional beos system add-ons input_server methods : canna ; #pragma mark - # Set image name and directory defaults and locate the image. HAIKU_IMAGE_NAME ?= haiku.image ; HAIKU_IMAGE_DIR ?= $(HAIKU_OUTPUT_DIR) ; HAIKU_IMAGE ?= $(HAIKU_IMAGE_NAME) ; HAIKU_IMAGE_SIZE ?= 100 ; # 100 MB MakeLocate $(HAIKU_IMAGE) : $(HAIKU_IMAGE_DIR) ; # Set the default installation directory. HAIKU_INSTALL_DIR ?= /Haiku ; # the pseudo target all image contents is attached to NotFile haiku-image-contents ; # prepare the script that initializes the shell variables HAIKU_IMAGE_INIT_VARIABLES_SCRIPT = haiku.image-init-vars ; local script = $(HAIKU_IMAGE_INIT_VARIABLES_SCRIPT) ; MakeLocate $(script) : $(HAIKU_OUTPUT_DIR) ; Always $(script) ; AddVariableToScript $(script) : sourceDir : $(HAIKU_TOP) ; AddVariableToScript $(script) : outputDir : $(HAIKU_OUTPUT_DIR) ; AddVariableToScript $(script) : tmpDir : $(HAIKU_TMP_DIR) ; AddVariableToScript $(script) : installDir : $(HAIKU_INSTALL_DIR) ; #AddVariableToScript $(script) : isImage : 1 ; AddVariableToScript $(script) : imageSize : $(HAIKU_IMAGE_SIZE) ; AddVariableToScript $(script) : addBuildCompatibilityLibDir : $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ; AddTargetVariableToScript $(script) : bfs_shell : bfsShell ; AddTargetVariableToScript $(script) : fs_shell_command : fsShellCommand ; AddTargetVariableToScript $(script) : copyattr ; AddTargetVariableToScript $(script) : makebootable ; AddTargetVariableToScript $(script) : rc ; AddTargetVariableToScript $(script) : resattr ; #AddTargetVariableToScript $(script) : $(HAIKU_IMAGE) : imagePath ; # causes a cyclic dependency AddVariableToScript $(script) : imagePath : [ FDirName $(HAIKU_IMAGE_DIR) $(HAIKU_IMAGE_NAME) ] ; # create the other scripts HAIKU_IMAGE_MAKE_DIRS_SCRIPT = haiku.image-make-dirs ; HAIKU_IMAGE_COPY_FILES_SCRIPT = haiku.image-copy-files ; MakeLocate $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) $(HAIKU_IMAGE_COPY_FILES_SCRIPT) : $(HAIKU_OUTPUT_DIR) ; CreateHaikuImageMakeDirectoriesScript $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) ; CreateHaikuImageCopyFilesScript $(HAIKU_IMAGE_COPY_FILES_SCRIPT) ; # Convenience wrapper rule around BuildHaikuImage. rule _BuildHaikuImage { # _BuildHaikuImage : ; # local image = $(1) ; local isImage = $(2) ; # build the image # HAIKU_IMAGE_EARLY_USER_SCRIPTS, HAIKU_IMAGE_LATE_USER_SCRIPTS can be # specified by the user. BuildHaikuImage $(image) : $(HAIKU_IMAGE_INIT_VARIABLES_SCRIPT) $(HAIKU_IMAGE_EARLY_USER_SCRIPTS) $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) $(HAIKU_IMAGE_COPY_FILES_SCRIPT) $(HAIKU_IMAGE_LATE_USER_SCRIPTS) : $(isImage) ; # remove the scripts we have generated RmTemps $(image) : $(HAIKU_IMAGE_INIT_VARIABLES_SCRIPT) $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) $(HAIKU_IMAGE_COPY_FILES_SCRIPT) ; } # build the image _BuildHaikuImage $(HAIKU_IMAGE) : true ; NotFile haiku-image ; Depends haiku-image : $(HAIKU_IMAGE) ; # install Haiku into a directory NotFile install-haiku ; _BuildHaikuImage install-haiku : 0 ;