home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / DEV.Z / implicitrules.make < prev    next >
Encoding:
Text File  |  1996-09-08  |  3.1 KB  |  124 lines

  1. #
  2. # implicitrules.make
  3. #
  4. # Implicit rules for generating and compiling source code.
  5. #
  6. # IMPORTED VARIABLES
  7. #   All of the commands exported by commands-*.make
  8. #   All of the flags exported by flags.make
  9. #
  10.  
  11. #
  12. # eliminate all the default suffixes
  13. #
  14.  
  15. .SUFFIXES:
  16.  
  17. #
  18. # compiling
  19. #
  20.  
  21. .SUFFIXES: .o .h .c .m .cc .cxx .C .mm .mxx .M .s
  22.  
  23. .c.o:
  24.     $(CC) $(ALL_CFLAGS) -c -o $(OFILE_DIR)/$*.o $<
  25.  
  26. .m.o:
  27.     $(CC) $(ALL_MFLAGS) -c -o $(OFILE_DIR)/$*.o $<
  28.  
  29. .cc.o .C.o .cxx.o:
  30.     $(CC) $(ALL_CCFLAGS) -c -o $(OFILE_DIR)/$*.o $<
  31.  
  32. .mm.o .M.o .mxx.o:
  33. ifneq "YES" "$(DISABLE_OBJCPLUSPLUS)"
  34.     $(CC) $(ALL_MMFLAGS) -c -o $(OFILE_DIR)/$*.o $<
  35. else
  36.     $(SILENT) $(ECHO) Sorry, Objective-C++ compilation of $*.M not supported.
  37.     $(TOUCH) $(SFILE_DIR)/$*.m
  38.     $(CC) -c $(SFILE_DIR)/$*.m -o $(OFILE_DIR)/$*.o
  39.     $(RM) -f $(SFILE_DIR)/$*.m
  40. endif
  41.  
  42. .s.o:
  43.     $(CC) $(ALL_CFLAGS) -c -o $(OFILE_DIR)/$*.o $<
  44.  
  45. #
  46. # pswraps
  47. #
  48.  
  49. .SUFFIXES: .psw .pswm .h .c .m
  50.  
  51. .psw.h: 
  52.     $(PSWRAP) $(ALL_PSWFLAGS) -a -h $(SFILE_DIR)/$*.h -o $(SFILE_DIR)/$*.c $<
  53. .psw.c:
  54.     $(PSWRAP) $(ALL_PSWFLAGS) -a -h $(SFILE_DIR)/$*.h -o $(SFILE_DIR)/$*.c $<
  55. .pswm.h:
  56.     $(PSWRAP) $(ALL_PSWFLAGS) -a -h $(SFILE_DIR)/$*.h -o $(SFILE_DIR)/$*.m $<
  57. .pswm.m:
  58.     $(PSWRAP) $(ALL_PSWFLAGS) -a -h $(SFILE_DIR)/$*.h -o $(SFILE_DIR)/$*.m $<
  59.  
  60. #
  61. # Yacc and Lex
  62. #
  63.  
  64. .SUFFIXES: .y .l .h .c
  65.  
  66. .y.c .y.h:
  67.     $(CD) $(SFILE_DIR) && $(YACC) $(ALL_YFLAGS) $(shell pwd)/$<
  68.     $(MV) $(SFILE_DIR)/y.tab.h $(SFILE_DIR)/$*.h
  69.     $(MV) $(SFILE_DIR)/y.tab.c $(SFILE_DIR)/$*.c
  70.  
  71. .l.c:
  72.     $(CD) $(SFILE_DIR) && $(LEX) $(ALL_LFLAGS) $(shell pwd)/$<
  73.     $(MV) $(SFILE_DIR)/lex.yy.c $(SFILE_DIR)/$*.c
  74.  
  75. #
  76. # Precompiled headers
  77. #
  78.  
  79. .SUFFIXES: .h .p
  80.  
  81. .h.p:
  82.     -$(CC) $(ALL_PRECOMPFLAGS) $*.h -o $*.p
  83.     $(SILENT) if [ -n "$(findstring $@, $(PUBLIC_HEADERS))" ] ; then \
  84.        cmd="cd $(PUBLIC_HDR_DIR)$(PUBLIC_HEADER_DIR_SUFFIX) && $(CC) $(ALL_PRECOMPFLAGS) $*.h -o $*.p" ; $(ECHO) $$cmd ; eval $$cmd ; \
  85.     fi
  86.     $(SILENT) if [ -n "$(findstring $@, $(PRIVATE_HEADERS))" ] ; then \
  87.        cmd="cd $(PRIVATE_HDR_DIR)$(PRIVATE_HEADER_DIR_SUFFIX) && $(CC) $(ALL_PRECOMPFLAGS) $*.h -o $*.p" ; $(ECHO) $$cmd ; eval $$cmd ; \
  88.     fi
  89.     $(SILENT) if [ -n "$(findstring $@, $(PROJECT_HEADERS))" ] ; then \
  90.        cmd="cd $(PROJECT_HDR_DIR)$(PROJECT_HEADER_DIR_SUFFIX) && $(CC) $(ALL_PRECOMPFLAGS) $*.h -o $*.p" ; $(ECHO) $$cmd ; eval $$cmd ; \
  91.     fi
  92.         # Note that because precomps must go in the same directory as the .h
  93.         # we may not be able to write the precomp in the local case, so use a '-'
  94.  
  95. #
  96. # mig, msgwrap, and rpcgen
  97. #
  98.  
  99. ifneq "" "$(MIG)"
  100. %.h %Server.c %User.c: %.defs
  101.     $(CD) $(SFILE_DIR) && $(MIG) $(ALL_MIGFLAGS) $(shell pwd)/$<
  102. %.h %Server.c %User.c: %.mig
  103.     $(CD) $(SFILE_DIR) && $(MIG) $(ALL_MIGFLAGS) $(shell pwd)/$<
  104. else
  105. %.h: %.h.mig
  106.     $(CP) $< $(SFILE_DIR)/$@
  107. %User.c: %User.c.mig
  108.     $(CP) $< $(SFILE_DIR)/$@
  109. %Server.c: %Server.c.mig
  110.     $(CP) $< $(SFILE_DIR)/$@
  111. endif
  112.  
  113. %Speaker.h %Speaker.m %Listener.h %Listener.m: %.msg
  114.     $(CD) $(SFILE_DIR) && $(MSGWRAP) $(shell pwd)/$<
  115.  
  116. %.h: %.x
  117.     $(RPCGEN) $(ALL_RPCFLAGS) -h -o $(SYM_DIR)/$*.h $*.x
  118. %.c: %.x_svc
  119.     $(RPCGEN) $(ALL_RPCFLAGS) -s udp -s tcp -o $(SYM_DIR)/$*_svc.c $*.x
  120. %.c: %.x_clnt
  121.     $(RPCGEN) $(ALL_RPCFLAGS) -l -o $(SYM_DIR)/$*_clnt.c $*.x
  122. %.c: %.x_xdr
  123.     $(RPCGEN) $(ALL_RPCFLAGS) -c -o $(SYM_DIR)/$*_xdr.c $*.x
  124.