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

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

unix.superglobalmegacorp.com

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