home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / os / bsdss4.tz / bsdss4 / bsdss / emulator / Makefile < prev    next >
Encoding:
Makefile  |  1992-07-09  |  4.5 KB  |  167 lines

  1. #
  2. #  Mach Operating System
  3. #  Copyright (c) 1991,1990,1989 Carnegie Mellon University
  4. #  All Rights Reserved.
  5. #  
  6. #  Permission to use, copy, modify and distribute this software and its
  7. #  documentation is hereby granted, provided that both the copyright
  8. #  notice and this permission notice appear in all copies of the
  9. #  software, derivative works or modified versions, and any portions
  10. #  thereof, and that both notices appear in supporting documentation.
  11. #  
  12. #  CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13. #  CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14. #  ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15. #  
  16. #  Carnegie Mellon requests users of this software to return to
  17. #  
  18. #   Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  19. #   School of Computer Science
  20. #   Carnegie Mellon University
  21. #   Pittsburgh PA 15213-3890
  22. #  
  23. #  any improvements or extensions that they make and grant Carnegie the
  24. #  rights to redistribute these changes.
  25. # Makefile for bsd emulator.
  26. #
  27. # HISTORY
  28. # $Log:    Makefile,v $
  29. # Revision 2.4  92/07/08  16:11:25  mrt
  30. #     Used ASCPP for preprocessing .s files as vanilla gcc does not
  31. #     understand the -ES switch.
  32. #     [92/07/06            mrt]
  33. # Revision 2.3  92/06/25  17:19:05  mrt
  34. #     Modified for ODE make
  35. #     [92/06/16            mrt]
  36.  
  37. # all directories that are in INCFLAGS or INCDIRS must be here so
  38. # that make can find the relative dependencies that md will generate
  39. VPATH    = ${target_machine}:../server:${EXPORTBASE}/bsdss${INCDIRS:S/-I/:/g}
  40.  
  41. OTHERS        = emulator
  42. DEPENDENCIES    =
  43. MIG_HDRS    =
  44. PROGRAMS    = 
  45.  
  46. INCFLAGS    = -I. -I../server -I${EXPORTBASE}/bsdss
  47. #INCDIRS    = -I${EXPORTBASE}/usr/include  (set in setvar.csh)
  48.  
  49. CC_OPT_LEVEL    = -g
  50. DEFINES        = -DCMUCS=1 -DTypeCheck=0 -DMACH_IPC_COMPAT=0 -DCOMPAT_43
  51. CFLAGS        = ${DEFINES}
  52.  
  53. PMAXASFLAGS    = -nocpp
  54. PMAXLDFLAGS    = -e __start
  55. AT386LDFLAGS    = -x -e __start ${LIBDIRS}
  56. I386LDFLAGS    = -x -e __start ${LIBDIRS}
  57.  
  58. MIGFLAGS     = ${DEFINES}
  59. ASFLAGS        = ${${TARGET_MACHINE}ASFLAGS}
  60. LDFLAGS        = $(${TARGET_MACHINE}LDFLAGS:U-x -e start)
  61.  
  62. LIBS        = -lthreads -lmach_sa 
  63. #CRT0        = ${EXPORTBASE}/usr/lib/crt0.o
  64. CRT0        != wh -q -L crt0.o
  65. #LIBDIRS    = -L${EXPORTBASE}/usr/lib (set in setvar.csh)
  66.  
  67.  
  68. OFILES= bsd_user_side.o emul_init.o emul_stack_alloc.o emul_generic.o \
  69.     allocator.o mach_user.o emul_sysent.o\
  70.     emul_machdep.o emul_vector.o bsd_1_user.o emul_cache.o \
  71.     emul_mapped.o
  72.  
  73. .include <${RULES_MK}>
  74.  
  75. emulator: ${OFILES} emulator_base
  76.     ${_LD_} -z -o emulator -T `./emulator_base` ${_LDFLAGS_} ${OFILES} \
  77.         ${CRT0} ${_LIBS_}
  78.     -xstrip emulator
  79.  
  80. #  Leave out the optimzation flags as gcc-cpp doesn't like  them
  81.  
  82. _CPPFLAGS_=\
  83.     ${_CC_CFLAGS_}\
  84.     ${${.TARGET}_CENV:U${CENV}}\
  85.     ${${.TARGET}_CFLAGS:U${CFLAGS}} ${TARGET_FLAGS}\
  86.     ${${.TARGET}_CARGS:U${CARGS}}\
  87.     ${_CC_NOSTDINC_} ${_GENINC_} ${_CC_INCDIRS_} ${_CC_PICLIB_}
  88.  
  89. .s.o:
  90.     $(ASCPP) ${_CPPFLAGS_} ${.IMPSRC} > ${.PREFIX:T}.as
  91.     $(AS) ${ASFLAGS} -o ${.TARGET} ${.PREFIX:T}.as
  92. #    rm -f ${.PREFIX}.as
  93.  
  94. emulator_base: emulator_base.c
  95.     $(_CC_) $(_CCFLAGS_) -o emulator_base ${emulator_base.c:P}
  96.  
  97. bsd_1_user.o: uxkern/bsd_1_user.c
  98.     $(_CC_) $(_CCFLAGS_) -c -o bsd_1_user.o ${uxkern/bsd_1_user.c:P}
  99.  
  100. bsd_user_side.o: uxkern/bsd_1.h
  101.  
  102.  
  103. #
  104. #  The sysent tables, mapping trap numbers to actions, are generated
  105. #  automatically on both the emulator and the server side:
  106. #
  107. bsd_user_side.o : sys/syscall.h
  108.  
  109. sys/syscall.h: emul_sysent.c
  110.  
  111. emul_sysent.c: ../server/kern/makesyscalls.sh ../server/kern/syscalls.master
  112.     -rm -rf tmp sys
  113.     -mkdir tmp sys
  114.     cd tmp;/bin/sh ../${../server/kern/makesyscalls.sh:P} \
  115.             ../${../server/kern/syscalls.master:P}
  116.  
  117. #
  118. #  Mach IPC-based interfaces
  119. #
  120.  
  121. MAKE_UXKERN = [ -d uxkern ] || mkdir uxkern
  122.  
  123.  
  124. BSD_FILES = uxkern/bsd_1.h uxkern/bsd_1_user.c
  125.  
  126. $(BSD_FILES): uxkern/bsd_types_gen.h uxkern/bsd_1.defs
  127.     -$(MAKE_UXKERN)
  128.     $(MIG) $(_MIGFLAGS_) \
  129.         -header uxkern/bsd_1.h \
  130.         -user uxkern/bsd_1_user.c \
  131.         -server /dev/null \
  132.         ${uxkern/bsd_1.defs:P}
  133.  
  134. #
  135. # We have to tell Mig to generate a header file, even though we don't really
  136. # want it, because the user file includes the header file from the current
  137. # directory.
  138. #
  139.  
  140. mach_user.c: mach/mach.defs
  141.     $(MIG) $(_MIGFLAGS_) -DEMULATOR \
  142.         -header mach_interface.h \
  143.         -user mach_user.c \
  144.         -server /dev/null \
  145.         ${mach/mach.defs:P}
  146.  
  147. uxkern/bsd_types_gen.h : bsd_types_gen
  148.     -$(MAKE_UXKERN)
  149.     ./bsd_types_gen > uxkern/bsd_types_gen.h
  150.  
  151. bsd_types_gen : bsd_types_gen.o
  152.     ${_host_CC_} -o bsd_types_gen bsd_types_gen.o
  153.  
  154. bsd_types_gen.o : uxkern/bsd_types_gen.c
  155.     ${_host_CC_} -c ${_CCFLAGS_} ${uxkern/bsd_types_gen.c:P}
  156.  
  157. .if exists(depend.mk)
  158. .include "depend.mk"
  159. .endif
  160.  
  161. printenv:
  162.     @echo VPATH ${VPATH}
  163.     printenv _MAKEPSD
  164.