Annotation of Gnu-Mach/Makefile.in, revision 1.1.1.1

1.1       root        1: # Makefile for Mach 4 kernel directory
                      2: # Copyright 1997 Free Software Foundation, Inc.
                      3: #
                      4: # Permission to use, copy, modify and distribute this software and its
                      5: # documentation is hereby granted, provided that both the copyright
                      6: # notice and this permission notice appear in all copies of the
                      7: # software, derivative works or modified versions, and any portions
                      8: # thereof, and that both notices appear in supporting documentation.
                      9: # 
                     10: # THE FREE SOFTWARE FOUNDATION ALLOWS FREE USE OF THIS SOFTWARE IN ITS
                     11: # "AS IS" CONDITION.  THE FREE SOFTWARE FOUNDATION DISCLAIMS ANY
                     12: # LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
                     13: # USE OF THIS SOFTWARE.
                     14: 
                     15: 
                     16: 
                     17: 
                     18: # Variables from `configure'.
                     19: srcdir=@srcdir@
                     20: systype=@systype@
                     21: prefix=@prefix@
                     22: 
                     23: installed-clib=$(prefix)/lib/libcrt.a
                     24: exec_prefix=$(prefix)
                     25: 
                     26: bootdir=$(exec_prefix)/boot
                     27: includedir=$(prefix)/include
                     28: libexecdir=$(exec_prefix)/libexec
                     29: bindir=$(exec_prefix)/bin
                     30: 
                     31: sysdep = $(srcdir)/$(systype)
                     32: 
                     33: cross_compiling=@cross_compiling@
                     34: 
                     35: # Programs found by configure.
                     36: AWK=@AWK@
                     37: INSTALL=@INSTALL@
                     38: CC=@CC@
                     39: BUILD_CC=@BUILD_CC@
                     40: LEX=@LEX@
                     41: YACC=@YACC@
                     42: 
                     43: LEXLIB=@LEXLIB@
                     44: 
                     45: INSTALL_PROGRAM=$(INSTALL)
                     46: INSTALL_DATA=$(INSTALL) -m 644
                     47: 
                     48: CFLAGS=@CFLAGS@
                     49: 
                     50: # We build these locally
                     51: MIG=./mig
                     52: MIGCOM=./migcom
                     53: 
                     54: all:
                     55: 
                     56: # All the possible architectures
                     57: all-archs = i386
                     58: 
                     59: all-archs-subdirs = $(patsubst %,$(srcdir)/%/Subdirs,$(all-archs))
                     60: all-archs-files = $(patsubst %,$(srcdir)/%/Files,$(all-archs))
                     61: 
                     62: # Files distributed from the top level directory:
                     63: topfiles = ChangeLog ChangeLog.0 ChangeLog.00 Drivers.macros Makefile.in \
                     64:        README INSTALL config.guess config.sub configure configure.in \
                     65:        gensym.awk install-sh version.c
                     66: 
                     67: # All the source in each directory.  
                     68: 
                     69: # Old crud from a previous configure scheme
                     70: bogus-files = bootstrap_symbols.h fast_tas.h hw_footprint.h net_atm.h \
                     71:        power_save.h simple_clock.h stat_time.h xpr_debug.h \
                     72:        $(patsubst %,mach_%.h,assert counters debug fixpri host ipc_compat \
                     73:        ipc_debug ipc_test kdb ldebug lock_mon machine_routines mp_debug \
                     74:        pagemap pcsample ttd vm_debug) \
                     75:        $(patsubst %,norma_%.h,device ether ipc task vm)
                     76: 
                     77: # Generic code for various hardware drivers
                     78: chips-files = atm.c audio.c bt431.c bt455.c bt459.c build_font.c busses.c \
                     79:        cfb_hdw.c cfb_misc.c dc503.c dtop_handlers.c dtop_hdw.c dz_hdw.c \
                     80:        fb_hdw.c fb_misc.c fdc_82077_hdw.c frc.c ims332.c isdn_79c30_hdw.c \
                     81:        kernel_font.c lance.c lance_mapped.c lk201.c mc_clock.c mouse.c \
                     82:        nc.c nw_mk.c pm_hdw.c pm_misc.c scc_8530_hdw.c screen.c \
                     83:        screen_switch.c serial_console.c sfb_hdw.c sfb_misc.c spans.c \
                     84:        tca100.c tca100_if.c xcfb_hdw.c xcfb_misc.c \
                     85:        atmreg.h audio_config.h audio_defs.h bt431.h bt455.h bt459.h \
                     86:        bt478.h busses.h dc503.h dtop.h dz_7085.h dz_defs.h eccreg.h \
                     87:        fdc_82077.h ims332.h isdn_79c30.h lance.h lk201.h mc_clock.h \
                     88:        nc.h nw.h nw_mk.h pm_defs.h scc_8530.h screen.h screen_defs.h \
                     89:        screen_switch.h serial_defs.h spans.h tca100.h tca100_if.h \
                     90:        vs42x_rb.h xcfb_monitor.h
                     91: 
                     92: # Generic code for various SCSI unit types
                     93: scsi-files = disk_label.c mapped_scsi.c pc_scsi_label.c rz.c rz_audio.c \
                     94:        rz_cpu.c rz_disk.c rz_disk_bbr.c rz_host.c rz_tape.c scsi.c \
                     95:        scsi_alldevs.c scsi_comm.c scsi_cpu.c scsi_disk.c scsi_jukebox.c \
                     96:        scsi_optical.c scsi_printer.c scsi_rom.c scsi_scanner.c \
                     97:        scsi_tape.c scsi_worm.c \
                     98:        compat_30.h mapped_scsi.h rz.h rz_labels.h scsi.h scsi2.h \
                     99:        scsi_defs.h scsi_endian.h
                    100: 
                    101: # Icky kernel debugger
                    102: ddb-cfiles = $(addprefix db_,$(ddb-names))
                    103: ddb-names = access.c aout.c break.c command.c cond.c examine.c expr.c \
                    104:        ext_symtab.c input.c lex.c macro.c mp.c output.c print.c run.c \
                    105:        sym.c task_thread.c trap.c variables.c watch.c write_cmd.c
                    106: ddb-files = $(ddb-cfiles) $(patsubst %,db_%.h, \
                    107:        access break command expr lex output print run sym task_thread \
                    108:        variables watch) nlist.h stab.h tr.h
                    109: 
                    110: # Device support interfaces
                    111: device-files = blkio.c chario.c cirbuf.c cons.c dev_lookup.c dev_name.c \
                    112:        dev_pager.c device_init.c dk_label.c ds_routines.c net_io.c subrs.c \
                    113:        buf.h cirbuf.h conf.h cons.h dev_hdr.h dev_master.h device_port.h \
                    114:        device_types_kernel.h ds_routines.h errno.h if_ether.h if_hdr.h \
                    115:        io_req.h net_io.h param.h tty.h memory_object_reply.cli \
                    116:        dev_forward.defs device_pager.srv device_reply.cli device.srv
                    117: 
                    118: # IPC implementation
                    119: ipc-cfiles = $(addprefix ipc_,$(ipc-names)) \
                    120:                mach_msg.c mach_port.c mach_rpc.c mach_debug.c fipc.c
                    121: ipc-names = entry.c hash.c init.c kmsg.c marequest.c mqueue.c \
                    122:        notify.c object.c port.c pset.c right.c space.c splay.c \
                    123:        table.c target.c thread.c 
                    124: ipc-files = $(ipc-cfiles) mach_port.srv fipc.h port.h mach_msg.h \
                    125:        $(patsubst %,ipc_%.h, \
                    126:        entry hash init kmsg kmsg_queue machdep marequest mqueue notify \
                    127:        object port pset right space splay table target thread types)
                    128: 
                    129: # "kernel" implementation (tasks, threads, trivia, etc.)
                    130: kern-cfiles = act.c ast.c bootstrap.c counters.c debug.c eventcount.c \
                    131:        exception.c host.c ipc_host.c ipc_kobject.c ipc_mig.c ipc_sched.c \
                    132:        ipc_tt.c kalloc.c lock.c lock_mon.c mach_clock.c mach_factor.c \
                    133:        machine.c pc_sample.c printf.c priority.c processor.c profile.c \
                    134:        queue.c sched_prim.c startup.c strings.c syscall_emulation.c \
                    135:        syscall_subr.c syscall_sw.c task.c thread.c thread_swap.c \
                    136:        time_stamp.c timer.c xpr.c zalloc.c elf-load.c
                    137: kern-files = $(kern-cfiles) \
                    138:        act.h assert.h ast.h compat_xxx_defs.h counters.h cpu_number.h \
                    139:        debug.h eventcount.h host.h ipc_host.h ipc_kobject.h ipc_sched.h \
                    140:        ipc_tt.h kalloc.h kern_types.h lock.h mach_param.h macro_help.h \
                    141:        pc_sample.h processor.h queue.h refcount.h sched.h sched_prim.h \
                    142:        shuttle.h strings.h syscall_emulation.h syscall_subr.h syscall_sw.h \
                    143:        task.h thread.h thread_swap.h time_out.h time_stamp.h timer.h xpr.h \
                    144:        zalloc.h \
                    145:        mach.srv mach4.srv mach_debug.srv mach_host.srv
                    146: 
                    147: # Still more trivia
                    148: util-cfiles = about_to_die.c cpu.c cpu_init.c die.c putchar.c puts.c
                    149: util-files = $(util-cfiles) config.h cpu.h cpu_subs.h cpus.h debug.h \
                    150:        phys_mem.h ref_count.h
                    151: 
                    152: # Virtual memory implementation
                    153: vm-cfiles = $(addprefix vm_,$(vm-names)) memory_object.c 
                    154: vm-names = debug.c external.c fault.c init.c kern.c map.c \
                    155:        object.c pageout.c resident.c user.c
                    156: vm-files = $(vm-cfiles) memory_object_default.cli memory_object_user.cli \
                    157:        memory_object.h pmap.h $(patsubst %,vm_%.h, \
                    158:        external fault kern map object page pageout user)
                    159: 
                    160: 
                    161: 
                    162: # Object files that go into the kernel image.  (This will be augmented by the
                    163: # machine dependent Makefile fragment.)
                    164: 
                    165: # Basic kernel source for Mach
                    166: objfiles := $(subst .c,.o,$(ipc-cfiles) $(kern-cfiles) \
                    167:                          $(util-cfiles) $(vm-cfiles))
                    168: vpath %.c $(srcdir)/ipc $(srcdir)/kern $(srcdir)/util $(srcdir)/vm
                    169: 
                    170: # These device support files are always needed; the others are needed only
                    171: # if particular drivers want the routines.
                    172: # XXX functions in device/subrs.c should each be moved elsewhere
                    173: objfiles += cons.o dev_lookup.o dev_name.o dev_pager.o device_init.o \
                    174:        ds_routines.o subrs.o net_io.o blkio.o chario.o
                    175: vpath %.c $(srcdir)/device
                    176: 
                    177: # DDB support -- eventually to die.  Please.
                    178: objfiles += $(subst .c,.o,$(ddb-cfiles))
                    179: vpath %.c $(srcdir)/ddb
                    180: 
                    181: # Version number
                    182: objfiles += version.o
                    183: vpath version.c $(srcdir)
                    184: 
                    185: 
                    186: # Header files installed for user use
                    187: device-headers= $(addprefix device/,audio_status.h bpf.h device.defs \
                    188:                device_reply.defs device_request.defs device_types.defs \
                    189:                device_types.h disk_status.h net_status.h tape_status.h \
                    190:                tty_status.h)
                    191: mach-headers= $(addprefix mach/, bootstrap.defs default_pager.defs \
                    192:                default_pager_helper.defs default_pager_types.defs \
                    193:                exc.defs mach.defs mach4.defs mach_host.defs mach_norma.defs \
                    194:                mach_port.defs mach_types.defs memory_object.defs \
                    195:                memory_object_default.defs norma_task.defs notify.defs \
                    196:                std_types.defs \
                    197:                alert.h boolean.h boot.h default_pager_types.h exception.h \
                    198:                host_info.h kern_return.h mach_param.h mach_types.h \
                    199:                machine.h macro_help.h memory_object.h message.h mig_errors.h \
                    200:                msg_type.h multiboot.h norma_special_ports.h notify.h \
                    201:                pc_sample.h policy.h port.h proc_ops.h processor_info.h \
                    202:                profil.h profilparam.h rpc.h std_types.h syscall_sw.h \
                    203:                task_info.h task_special_ports.h thread_info.h \
                    204:                thread_special_ports.h thread_status.h thread_switch.h \
                    205:                time_value.h version.h vm_attributes.h vm_inherit.h \
                    206:                vm_param.h vm_prot.h vm_statistics.h inline.h)
                    207: mach-exec-headers= $(addprefix mach/exec/, a.out.h elf.h exec.h)
                    208: mach-debug-headers:= $(addprefix mach_debug/, hash_info.h ipc_info.h \
                    209:                mach_debug.defs mach_debug_types.defs mach_debug_types.h \
                    210:                pc_info.h vm_info.h zone_info.h)
                    211: 
                    212: installed-headers:= $(device-headers) $(mach-headers) $(mach-exec-headers)
                    213: 
                    214: # Other headers for the distribution.  We don't install these, because the 
                    215: # GNU C library has correct versions for users to use.
                    216: other-sys-headers := types.h time.h reboot.h ioctl.h
                    217: other-mach-headers := mig_support.h mach_traps.h error.h
                    218: other-headers := alloca.h
                    219: 
                    220: 
                    221: # We steal routines from the C library and put them here.
                    222: # If we link against the C library directly, then we have to hope that we have
                    223: # correctly found all the dependencies that might bring in C library code.
                    224: # This method is much safer because it's easy to check this one object file
                    225: # for sanity.
                    226: objfiles += clib-routines.o
                    227: 
                    228: clib-routines = memcpy memset bcopy bzero htonl ntohl ntohs
                    229: 
                    230: clib-routines.o: $(installed-clib)
                    231:        $(LD) -o clib-routines.o -r $(addprefix -u ,$(clib-routines)) $(installed-clib)
                    232: 
                    233: # This rule checks clib-routines and makes sure it doesn't have any 
                    234: # extra symbols.
                    235: kernel: check-clib-routines
                    236: check-clib-routines: clib-routines.o
                    237:        test `echo $(clib-routines) | wc -w` -eq `nm $< | wc -l` && touch check-clib-routines
                    238: 
                    239: 
                    240: # Empty dependency file
                    241: clib-routines.d:; touch $@
                    242: 
                    243: 
                    244: 
                    245: # Automatically generated source
                    246: 
                    247: # User stubs
                    248: objfiles += memory_object_user_user.o memory_object_default_user.o \
                    249:        device_reply_user.o memory_object_reply_user.o
                    250: 
                    251: # Server stubs
                    252: objfiles += device_server.o device_pager_server.o mach_port_server.o \
                    253:        mach_server.o mach4_server.o mach_debug_server.o mach_host_server.o
                    254: 
                    255: # Where to find the relevant Mig source files
                    256: vpath %.cli $(srcdir)/vm $(srcdir)/device
                    257: vpath %.srv $(srcdir)/device $(srcdir)/ipc $(srcdir)/kern
                    258: 
                    259: 
                    260: 
                    261: 
                    262: #
                    263: # Compilation flags
                    264: #
                    265: 
                    266: DEFINES += -DMACH -DCMU -DMACH_KERNEL -DKERNEL
                    267: INCLUDES += -I. -I$(srcdir) -I$(srcdir)/include \
                    268:        -I$(srcdir)/bogus -I$(srcdir)/util -I$(srcdir)/kern -I$(srcdir)/device
                    269: 
                    270: 
                    271: include $(sysdep)/Makefrag
                    272: 
                    273: CPPFLAGS += -nostdinc $(DEFINES) $(INCLUDES) 
                    274: 
                    275: MIGFLAGS += $(CPPFLAGS)
                    276: 
                    277: 
                    278: all: kernel cross-migcom
                    279: 
                    280: 
                    281: #
                    282: # Kernel Image
                    283: #
                    284: # (The newline in this command makes it much easier to read in make output.)
                    285: kernel: $(objfiles)
                    286:        $(LD) -o $@ $(LDFLAGS) \
                    287:                $(objfiles)
                    288: 
                    289: 
                    290: 
                    291: #
                    292: # Installation
                    293: # 
                    294: installed-headers-names = $(addprefix $(includedir)/,$(installed-headers))
                    295: installed-sysdep-headers-names = $(addprefix $(includedir)/,$($(systype)-installed-headers))
                    296: install: mkinstalldirs kernel $(installed-headers-names) $(installed-sysdep-headers-names) cross-mig cross-migcom
                    297:        $(INSTALL_PROGRAM) kernel $(bootdir)/gnumach
                    298:        $(INSTALL_PROGRAM) cross-mig $(bindir)/mig
                    299:        $(INSTALL_PROGRAM) cross-migcom $(libexecdir)/mig
                    300:        -ln -s $(systype) $(includedir)/mach/machine
                    301: 
                    302: $(installed-headers-names): $(includedir)/%: $(srcdir)/include/%
                    303:        $(INSTALL_DATA) $< $@
                    304: 
                    305: $(installed-sysdep-headers-names): $(includedir)/%: $(sysdep)/include/%
                    306:        $(INSTALL_DATA) $< $@
                    307: 
                    308: mkinstalldirs:
                    309:        mkdir -p $(bootdir) $(includedir) $(includedir)/device \
                    310:                $(includedir)/mach $(includedir)/mach/$(systype)
                    311: 
                    312: 
                    313: #
                    314: # Building the distribution
                    315: #
                    316: 
                    317: dist:
                    318:        rm -rf gnumach-$(version)
                    319:        mkdir gnumach-$(version)
                    320:        # Directories
                    321:        mkdir gnumach-$(version)/{bogus,chips,ddb,device,ipc,kern,mig,scsi,util,vm,include}
                    322:        mkdir gnumach-$(version)/include/{mach,device,mach_debug,sys}
                    323:        mkdir gnumach-$(version)/include/mach/exec
                    324:        for dir in `cat $(all-archs-subdirs)`; do \
                    325:                mkdir -p gnumach-$(version)/$$dir; \
                    326:        done
                    327:        # Files
                    328:        ln $(addprefix $(srcdir)/,$(topfiles)) gnumach-$(version)
                    329:        ln $(addprefix $(srcdir)/bogus/,$(bogus-files)) gnumach-$(version)/bogus
                    330:        ln $(addprefix $(srcdir)/chips/,$(chips-files)) gnumach-$(version)/chips
                    331:        ln $(addprefix $(srcdir)/ddb/,$(ddb-files)) gnumach-$(version)/ddb
                    332:        ln $(addprefix $(srcdir)/device/,$(device-files)) gnumach-$(version)/device
                    333:        ln $(addprefix $(srcdir)/ipc/,$(ipc-files)) gnumach-$(version)/ipc
                    334:        ln $(addprefix $(srcdir)/kern/,$(kern-files)) gnumach-$(version)/kern
                    335:        ln $(addprefix $(srcdir)/mig/,$(mig-files)) gnumach-$(version)/mig
                    336:        ln $(addprefix $(srcdir)/scsi/,$(scsi-files)) gnumach-$(version)/scsi
                    337:        ln $(addprefix $(srcdir)/util/,$(util-files)) gnumach-$(version)/util
                    338:        ln $(addprefix $(srcdir)/vm/,$(vm-files)) gnumach-$(version)/vm
                    339:        ln $(addprefix $(srcdir)/include/,$(mach-headers)) gnumach-$(version)/include/mach
                    340:        ln $(addprefix $(srcdir)/include/,$(device-headers)) gnumach-$(version)/include/device
                    341:        ln $(addprefix $(srcdir)/include/,$(mach-debug-headers)) gnumach-$(version)/include/mach_debug
                    342:        ln $(addprefix $(srcdir)/include/,$(mach-exec-headers)) gnumach-$(version)/include/mach/exec
                    343:        ln $(addprefix $(srcdir)/include/,$(other-headers)) gnumach-$(version)/include
                    344:        ln $(addprefix $(srcdir)/include/sys/,$(other-sys-headers)) gnumach-$(version)/include/sys
                    345:        ln $(addprefix $(srcdir)/include/mach/,$(other-mach-headers)) gnumach-$(version)/include/mach
                    346:        # Files in arch dirs
                    347:        for file in `cat $(all-archs-files)`; do \
                    348:                ln $(srcdir)/$$file gnumach-$(version)/`dirname $$file`; \
                    349:        done
                    350:        for arch in $(all-archs); do \
                    351:                ln -s $$arch gnumach-$(version)/$$arch/include/mach/machine; \
                    352:        done
                    353:        tar cfz gnumach-$(version).tar.gz gnumach-$(version)
                    354:        rm -rf gnumach-$(version)
                    355: 
                    356: 
                    357: 
                    358: #
                    359: # Autoconf support
                    360: #
                    361: $(srcdir)/configure: configure.in
                    362:        cd $(srcdir) && autoconf
                    363: 
                    364: Makefile: Makefile.in config.status
                    365:        ./config.status
                    366: 
                    367: config.status: configure
                    368:        ./config.status --recheck
                    369: 
                    370: vpath %.in $(srcdir)
                    371: vpath configure $(srcdir)
                    372: 
                    373: 
                    374: 
                    375: #
                    376: # How to do some things
                    377: # 
                    378: 
                    379: # Building foo.h from foo.sym:
                    380: %.symc: %.sym
                    381:        $(AWK) -f $(srcdir)/gensym.awk $< >$*.symc
                    382: %.symc.o: %.symc
                    383:        $(CC) -S $(CPPFLAGS) $(CFLAGS) $(CPPFLAGS-$@) -x c -o $@ $<
                    384: %.h: %.symc.o
                    385:        sed <$< -e 's/^[^*].*$$//' | \
                    386:                sed -e 's/^[*]/#define/' -e 's/mAgIc[^-0-9]*//' >$@
                    387: 
                    388: # Building from foo.cli
                    389: %.h %_user.c: %.cli $(MIG) $(MIGCOM)
                    390:        $(MIG) $(MIGFLAGS) -header $*.h -user $*_user.c -server /dev/null $<
                    391: 
                    392: # Building from foo.srv
                    393: %_interface.h %_server.c: %.srv $(MIG) $(MIGCOM)
                    394:        $(MIG) $(MIGFLAGS) -header $*_interface.h -server $*_server.c -user /dev/null $<
                    395: 
                    396: #
                    397: # Dependency generation
                    398: #
                    399: 
                    400: # Include dependency files
                    401: ifneq ($(no_deps),t)
                    402: 
                    403: # For each file generated by MiG we need a .d file.
                    404: servers = $(filter %_server.o,$(objfiles))
                    405: include $(subst _server.o,.migs_d,$(servers)) /dev/null
                    406: include $(subst _server.o,.migsh_d,$(servers)) /dev/null
                    407: 
                    408: # vm_user.o fits the pattern, but is not actually a MiG-related file.
                    409: users = $(filter-out vm_user.o,$(filter %_user.o,$(objfiles)))
                    410: include $(subst _user.o,.migu_d,$(users)) /dev/null
                    411: include $(subst _user.o,.miguh_d,$(users)) /dev/null
                    412: 
                    413: # For each .o file we need a .d file.
                    414: include $(subst .o,.d,$(filter %.o,$(objfiles))) /dev/null
                    415: 
                    416: endif
                    417: 
                    418: # Here is how to make those dependency files
                    419: 
                    420: %.migs_d: %.srv
                    421:        (set -e; $(CPP) $(MIGFLAGS) -M -MG -x c $< | \
                    422:        sed -e 's/\.srv\.o:/_server.c $@:/' > $@)
                    423: 
                    424: %.migu_d: %.cli
                    425:        (set -e; $(CPP) $(MIGFLAGS) -M -MG -x c $< | \
                    426:        sed -e 's/\.cli\.o:/_user.c $@:/' > $@)
                    427: 
                    428: %.migsh_d: %.migs_d
                    429:        sed -e 's/_server\.c /_interface.h /' -e 's/migs_d/migsh_d/' < $< > $@
                    430: 
                    431: %.miguh_d: %.migu_d
                    432:        sed -e 's/_user\.c /.h /' -e 's/migu_d/miguh_d/' < $< > $@
                    433: 
                    434: # Generic rule for $(CC) based compilation for making dependencies
                    435: define make-deps
                    436: set -e; $(CC) $(CFLAGS) $(CPPFLAGS) -M -MG $< | \
                    437:        sed > [email protected] -e 's/$*\.o:/$*.o $@:/'
                    438: mv -f [email protected] $@
                    439: endef
                    440: 
                    441: %.d: %.c; $(make-deps)
                    442: %.d: %.S; $(make-deps)
                    443: 
                    444: # .s files don't go through the preprocessor, so we do this
                    445: # This rule must come *after* the genuine ones above, so that
                    446: # make doesn't build a .s file and then make an empty dependency
                    447: # list.
                    448: %.d: %.s
                    449:        echo '$*.o: $<' > $@
                    450: 
                    451: 
                    452: # How to build MiG:
                    453: 
                    454: mig-objfiles = error.o global.o header.o lexxer.o migcom.o parser.o routine.o \
                    455:                server.o statement.o string.o type.o user.o utils.o
                    456: mig-csrcfiles = $(subst .o,.c,$(mig-objfiles))
                    457: mig-othersrc = alloc.h boolean.h error.h global.h lexxer.h message.h \
                    458:                mig_string.h routine.h statement.h type.h utils.h write.h \
                    459:                lexxer.l parser.y mig.sh parser.h cpu.sym
                    460: 
                    461: mig-files = $(mig-csrcfiles) $(mig-othersrc) ChangeLog
                    462: 
                    463: vpath cpu.sym $(srcdir)/mig
                    464: 
                    465: # Don't use $(CPPFLAGS) here; MiG needs none of the Mach headers except
                    466: # what happens automagically to build cpu.h.
                    467: 
                    468: # Here's how to build MiG for the target.
                    469: cross-mig-objfiles = $(addprefix cross-,$(mig-objfiles))
                    470: 
                    471: $(cross-mig-objfiles): cross-%.o: $(srcdir)/mig/%.c
                    472:        $(CC) -c $(CFLAGS) -I. -I$(srcdir)/mig -o $@ $<
                    473: 
                    474: ./cross-migcom: $(cross-mig-objfiles)
                    475:        $(CC) $(CFLAGS) $(cross-mig-objfiles) $(LEXLIB) -o $@
                    476: 
                    477: # Dependencies for these .o files
                    478: ifneq ($(no_deps),t)
                    479: include $(subst .o,.d,$(cross-mig-objfiles)) /dev/null
                    480: endif
                    481: 
                    482: $(subst .o,.d,$(cross-mig-objfiles)): cross-%.d: $(srcdir)/mig/%.c
                    483:        set -e; $(CC) $(CFLAGS) -M -MG -I. -I$(srcdir)/mig $< | \
                    484:                sed > [email protected] -e 's/$*\.o:/cross-$*.o $@:/'
                    485:        mv -f [email protected] $@
                    486: 
                    487: 
                    488: ifeq ($(cross_compiling),yes)
                    489: # When cross compiling, we build two migcoms; one for our use and one to 
                    490: # install.  Otherwise, we just build the one.
                    491: 
                    492: $(mig-objfiles): %.o: $(srcdir)/mig/%.c
                    493:        $(BUILD_CC) -c $(BUILD_CFLAGS) -I. -I$(srcdir)/mig -o $@ $<
                    494: 
                    495: ./migcom: $(mig-objfiles)
                    496:        $(BUILD_CC) $(BUILD_CFLAGS) $(mig-objfiles) $(LEXLIB) -o $@
                    497: 
                    498: ifneq ($(no_deps),t)
                    499: include $(subst .o,.d,$(mig-objfiles))
                    500: endif
                    501: 
                    502: $(subst .o,.d,$(mig-objfiles)): %.d: $(srcdir)/mig/%.c
                    503:        set -e; $(BUILD_CC) $(BUILD_CFLAGS) -M -MG -I. -I$(srcdir)/mig $< | \
                    504:                sed > [email protected] -e 's/$*\.o:/$*.o $@:/'
                    505:        mv -f [email protected] $@
                    506: 
                    507: else
                    508: ./migcom: ./cross-migcom
                    509:        rm -f $@
                    510:        ln $< $@
                    511: endif
                    512: 
                    513: $(srcdir)/mig/lexxer.c: $(srcdir)/mig/lexxer.l
                    514:        $(LEX) $(LFLAGS) $<
                    515:        mv lex.yy.c $*.c
                    516: 
                    517: $(srcdir)/mig/parser.c $(srcdir)/mig/parser.h: $(srcdir)/mig/parser.y
                    518:        $(YACC) $(YFLAGS) -d $<
                    519:        mv y.tab.c $(srcdir)/mig/parser.c
                    520:        mv y.tab.h $(srcdir)/mig/parser.h
                    521: 
                    522: # Version of mig script that looks for the right local tools
                    523: ifeq ($(cross_compiling),yes)
                    524: ./mig: $(srcdir)/mig/mig.sh Makefile
                    525:        sed -e 's,@MIGDIR@,.,g' \
                    526:            -e 's,@CPP@,${BUILD_CC} -x c-header -E,g' \
                    527:            $< >[email protected] && chmod +x [email protected] && mv -f [email protected] $@
                    528: else
                    529: ./mig: $(srcdir)/mig/mig.sh Makefile
                    530:        sed -e 's,@MIGDIR@,.,g' \
                    531:            -e 's,@CPP@,${CC} -x c-header -E,g' \
                    532:            $< >[email protected] && chmod +x [email protected] && mv -f [email protected] $@
                    533: endif
                    534: 
                    535: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.