home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / js / src / Makefile < prev    next >
Encoding:
Makefile  |  1998-04-08  |  4.8 KB  |  193 lines

  1. #! gmake
  2. # The contents of this file are subject to the Netscape Public License
  3. # Version 1.0 (the "NPL"); you may not use this file except in
  4. # compliance with the NPL.  You may obtain a copy of the NPL at
  5. # http://www.mozilla.org/NPL/
  6. #
  7. # Software distributed under the NPL is distributed on an "AS IS" basis,
  8. # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  9. # for the specific language governing rights and limitations under the
  10. # NPL.
  11. #
  12. # The Initial Developer of this code under the NPL is Netscape
  13. # Communications Corporation.  Portions created by Netscape are
  14. # Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  15. # Reserved.
  16.  
  17. DEPTH        = ../..
  18.  
  19. LIBRARY_NAME    = js
  20.  
  21. ifeq ($(subst /,_,$(shell uname -s)),OS2)
  22. ifndef XCFLAGS
  23. OS2_IMPLIB=1
  24. LIBRARY    = js$(MOZ_BITS)$(VERSION_NUMBER).$(LIB_SUFFIX)
  25. DEF_FILE    = jsos2$(VERSION_NUMBER).def
  26. EXTRA_LIBS    = $(LIBNSPR) $(LIBNSJAVA)
  27. else
  28. EXTRA_LIBS    = $(LIBNSPR) $(LIBNSJAVA) $(OBJDIR)/libjs.lib
  29. endif
  30. endif
  31.  
  32. MODULE        = js
  33.  
  34. CSRCS        = prmjtime.c \
  35.           jsapi.c \
  36.           jsarray.c \
  37.           jsatom.c \
  38.           jsbool.c \
  39.           jscntxt.c \
  40.           jsdate.c \
  41.           jsdbgapi.c \
  42.           jsemit.c \
  43.           jsfun.c \
  44.           jsgc.c \
  45.           jsinterp.c \
  46.           jsmath.c \
  47.           jsnum.c \
  48.           jsobj.c \
  49.           jsopcode.c \
  50.           jsparse.c \
  51.           jsregexp.c \
  52.           jsscan.c \
  53.           jsscope.c \
  54.           jsscript.c \
  55.           jsstr.c \
  56.           jslock.c \
  57.           $(NULL)
  58.  
  59. EXPORTS        = jsapi.h \
  60.           jsarray.h \
  61.           jsatom.h \
  62.           jsbool.h \
  63.           jscntxt.h \
  64.           jscompat.h \
  65.           jsconfig.h \
  66.           jsdate.h \
  67.           jsdbgapi.h \
  68.           jsemit.h \
  69.           jsfun.h \
  70.           jsgc.h \
  71.           jsinterp.h \
  72.           jslock.h \
  73.           jsmath.h \
  74.           jsnum.h \
  75.           jsobj.h \
  76.           jsopcode.def \
  77.           jsopcode.h \
  78.           jsparse.h \
  79.           jsprvtd.h \
  80.           jspubtd.h \
  81.           jsregexp.h \
  82.           jsscan.h \
  83.           jsscope.h \
  84.           jsscript.h \
  85.           jsstr.h \
  86.           $(NULL)
  87.  
  88. include $(DEPTH)/config/rules.mk
  89.  
  90. export:: install
  91.  
  92. ifndef BUILD_OPT
  93. MOCHAFILE    = 1
  94. endif
  95.  
  96. ifdef JSFILE
  97. DEFINES        += -DJSFILE
  98. endif
  99.  
  100. ifdef JS_THREADSAFE
  101. DEFINES += -DJS_THREADSAFE
  102. endif
  103.  
  104. ifdef JS_VERSION
  105. DEFINES += -DJS_VERSION=$(JS_VERSION)
  106. endif
  107.  
  108. INCLUDES    += -I. 
  109.  
  110. ifdef NSPR20
  111. INCLUDES    += -I$(DIST)/include/nspr20/pr
  112. else
  113. INCLUDES    += -I$(XPDIST)/public/nspr
  114. endif
  115.  
  116. ifndef NSBUILDROOT
  117. JSJAVA_STUBHEADERS = -I$(DEPTH)/sun-java/include/_gen \
  118.              -I$(DEPTH)/sun-java/netscape/javascript/_jri \
  119.              -I$(DEPTH)/sun-java/netscape/security/_jri
  120. else
  121. JSJAVA_STUBHEADERS = -I$(JRI_GEN_DIR) -I$(JDK_GEN_DIR)
  122. endif
  123. LDFLAGS        = $(DIST)/lib/libnspr.$(LIB_SUFFIX) -lm 
  124.  
  125. JSJAVA_CFLAGS    = -I$(DEPTH)/sun-java/md-include \
  126.           -I$(DEPTH)/sun-java/include \
  127.           $(JSJAVA_STUBHEADERS)
  128.  
  129. LDFLAGS        = $(DIST)/lib/libnspr.$(LIB_SUFFIX) -lm
  130.  
  131. ifeq ($(OS_ARCH), OSF1)
  132. LDFLAGS += -lc_r
  133. endif
  134. ifeq ($(OS_ARCH), SunOS)
  135. LDFLAGS += -lposix4 -ldl -lnsl -lsocket
  136. endif
  137.  
  138. # this requires clobbering and recompiling with XCFLAGS=-DJSFILE
  139. js:
  140.     $(MAKE) clobber
  141.     $(MAKE) XCFLAGS=-DJSFILE $(OBJDIR)/js$(BIN_SUFFIX)
  142.  
  143. .PHONY: js$(BIN_SUFFIX)
  144.  
  145. ifneq ($(OS_ARCH),OS2)
  146. $(OBJDIR)/js$(BIN_SUFFIX): $(OBJDIR)/js.o $(LIBRARY)
  147.         @$(MAKE_OBJDIR)
  148.         $(CC) -o $@ $(OBJDIR)/js.o $(LIBRARY) $(LDFLAGS)
  149. else
  150. OS_CFLAGS += -tm-
  151. $(OBJDIR)/js$(BIN_SUFFIX): $(OBJDIR)/js.o $(LIBRARY)
  152.         @$(MAKE_OBJDIR)
  153.         $(LINK_EXE) -OUT:$@ $(OBJDIR)/js.o  $(LIBRARIES) $(EXTRA_LIBS)
  154. endif
  155.  
  156. # hardwire dependencies on jsopcode.def
  157. jsopcode.h jsopcode.c: jsopcode.def
  158.  
  159. # this section was put in the merged by danda into the
  160. # JAVA_*_MERGE section and normally would have
  161. # been removed.  However it looks like it shouldn't have
  162. # been put there in the first place, so we're leaving it
  163. # here until danda can confirm (we don't have OS/2 machines
  164. # to build on) - hshaw/sudu
  165. #
  166. ifeq ($(OS_ARCH),OS2)
  167. $(OBJDIR)/js.o: js.c
  168.     @$(MAKE_OBJDIR)
  169.     $(CC) -Fo$@ -c $(CFLAGS) $(JSJAVA_CFLAGS) js.c
  170. endif
  171.  
  172.  
  173. refdiff:
  174.     @for f in `cat commfiles`; do                                         \
  175.         t=/tmp/refdiff.$$$$;                                              \
  176.         trap 'rm -f $$t' 0 1 2 15;                                        \
  177.         sed -f prconv.sed ../ref/$$f > $$t;                               \
  178.         cmp -s $$t $$f;                                                   \
  179.         if test $$? -ne 0; then                                           \
  180.         echo "=== $$f";                                               \
  181.         diff $$f $$t;                                                 \
  182.         fi;                                                               \
  183.         rm -f $$t;                                                        \
  184.     done
  185.  
  186. refconv:
  187.     @for f in `cat commfiles`; do                                         \
  188.         echo "=== $$f";                                                   \
  189.         sed -f prconv.sed ../ref/$$f > $$f;                               \
  190.     done
  191.  
  192. .PHONY: refdiff refconv
  193.