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

  1. #
  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. ##########################################################################
  18. #
  19. # Makefile for the Mozilla X front end.
  20. #
  21. # There are N dimensions to a full complement of binaries:
  22. #
  23. #    - target architecture
  24. #    - debug vs optimized
  25. #    - normal vs "lite"
  26. #    - normal vs purified
  27. #
  28. # A directory is needed for each of the first two dimensions (target
  29. # and debug), but executables for all of the others will then be built
  30. # in the same directory from the same .o files.  The files have names
  31. # as follows:
  32. #
  33. #    mozilla-export
  34. #    mozilla-nis-export    (SunOS 4 only)
  35. #    mozilla-export.pure    (SunOS 4 and Solaris only)
  36. #     ...etc...
  37. #
  38. # The only difference in the executables is which version of config-*.o
  39. # is linked in, and whether or not -lresolv is used.
  40. #
  41. ##########################################################################
  42.  
  43. DEPTH        = ../..
  44. MODULE        = xfe
  45.  
  46. USE_3PANE    = 1
  47.  
  48. MICROLINE_LIB    = $(DIST)/lib/libXmL.a
  49.  
  50. #
  51. # XFE2_DIR:
  52. #
  53. # HPUX_XMU_EXTRA_DIRS: On some HP-UX releases there is no Xmu.  So you
  54. #                      you might need to build your own.  See ftp://ftp.x.org
  55. #
  56. # MOTIF_HACK_DIRS:     Some bug fixes require Motif source code access.
  57. #                      Such hackery cannot be released because of OSF/Motif
  58. #                      licensing restrictions.
  59. #
  60.  
  61. include $(DEPTH)/config/config.mk
  62.  
  63. DIRS        = \
  64.           $(XFE2_DIR) \
  65.           $(HPUX_XMU_EXTRA_DIRS) \
  66.           $(MOTIF_HACK_DIRS) \
  67.           icons \
  68.           DtWidgets \
  69.           XfeWidgets \
  70.           Microline3.0/XmL \
  71.           $(NULL)
  72.  
  73. REQUIRES    = \
  74.         XfeWidgets \
  75.         Microline \
  76.           addr \
  77.           applet \
  78.           img \
  79.           edtplug \
  80.           jtools \
  81.           lay \
  82.           layer \
  83.           js \
  84.           libfont \
  85.           mariner \
  86.           msg \
  87.           plds \
  88.           nspr20 \
  89.           parse \
  90.           plug \
  91.           hook \
  92.           pref \
  93.           rdf \
  94.           xml \
  95.           security \
  96.           softupdt \
  97.           libreg \
  98.           style \
  99.           util \
  100.           java \
  101.           ldap \
  102.           xfeicons \
  103.           $(NULL)
  104.  
  105. CSRCS        = \
  106.           pref_helpers.c \
  107.           colors.c \
  108.           colorpicker.c \
  109.           altmail.c \
  110.           dragdrop.c \
  111.           e_kit.c \
  112.           fonts.c \
  113.           forms.c \
  114.           locale.c \
  115.           menu.c \
  116.           new_manage.c \
  117.           outline.c \
  118.           passwd.c \
  119.           scroller.c \
  120.           strids.c \
  121.           strings.c \
  122.           visual.c \
  123.           MozillaWm.c \
  124.           lite_stubs.c \
  125.           commands.c \
  126.           dialogs.c \
  127.           hot.c \
  128.           icons.c \
  129.           images.c \
  130.           lay.c \
  131.           mozilla.c \
  132.           prefs.c \
  133.           prefdialogs.c \
  134.           remote-s.c \
  135.           scroll.c \
  136.           selection.c \
  137.           xfe.c \
  138.           editor.c \
  139.           editordialogs.c \
  140.           $(NULL)
  141.  
  142. ifdef MOZ_MAIL_NEWS
  143. CSRCS        += \
  144.           addrbk.c \
  145.           mailattach.c \
  146.           mailcompose.c \
  147.           movemail.c \
  148.           $(NULL)
  149. endif
  150.  
  151. ifndef NO_UNIX_ASYNC_DNS
  152. CSRCS        += xfe-dns.c
  153. endif
  154.  
  155. XFE_PROGNAME    := mozilla
  156. DSO_PROGNAME    := moz
  157.  
  158. GUESS_CONFIG    := $(shell $(DEPTH)/config/config.guess | sed 's/i[23456]86/x86/')
  159.  
  160. #######################################################################
  161.  
  162. CCLD        = $(CCC)
  163. LDFLAGS        = $(CFLAGS)
  164. NOMD_LDFLAGS    = $(NOMD_CFLAGS)
  165.  
  166. ifdef MOZILLA_GPROF
  167. CSRCS        += gmon.c
  168. LDFLAGS        = $(OPTIMIZER)
  169. $(OBJDIR)/gmon.o:    gmon.c gmon.h
  170.     $(CC) -O -c -o $@ $<
  171. endif
  172.  
  173. ifdef SUB_UI
  174. CSRCS        += subui.c    
  175. endif
  176.  
  177. ifndef NO_LAYERS
  178. CSRCS        += region.c
  179. endif
  180.  
  181. ifeq ($(OS_ARCH),HP-UX)
  182. #
  183. # HP requires C++ programs to have main() in a C++ file.
  184. #
  185. CPPSRCS        = cplusplusmain.cc
  186. CFLAGS        += -DCPLUSPLUS_LINKAGE
  187. endif
  188.  
  189. OBJS        = $(CSRCS:.c=.o) $(CPPSRCS:.cc=.o)
  190.  
  191. GARBAGE        += e_kit_resources.h cxxlink-filter
  192.  
  193. ICONS_LIB    = $(DIST)/lib/lib$(LITE_PREFIX)xfeicons.a
  194.  
  195. DTWIDGETS_LIB    = $(DIST)/lib/libDtWidgets.a
  196. XFE_WIDGETS_LIB    = $(DIST)/lib/libXfeWidgets.a
  197. COMBOBOX_LIB    = $(DIST)/lib/libComboBox.a
  198.  
  199. ifeq ($(OS_ARCH),AIX)
  200. NSPR_LIB    = 
  201. else
  202. NSPR_LIB    = $(DIST)/lib/libplds21.a $(DIST)/lib/libplc21.a $(DIST)/lib/libmsgc21.a $(DIST)/lib/libnspr21.a
  203. endif
  204.  
  205. ifdef DBMALLOC
  206. NSPR_LIB    += $(DIST)/lib/libdbmalloc.a
  207. endif
  208.  
  209. XFE2_DIR    = src
  210. XFE2_LIB    = $(DIST)/lib/lib$(LITE_PREFIX)xfe2.a
  211.  
  212. ifndef DISABLE_MARINER
  213. CFLAGS        += -DENABLE_MARINER
  214. endif
  215.  
  216. #
  217. # We need libnet.a in there twice because libmsg and libnet have circular
  218. # dependencies on functions.
  219. #
  220. BASIC_LIBS    = \
  221.           $(XFE2_LIB) \
  222.           $(MICROLINE_LIB) \
  223.           $(ICONS_LIB) \
  224.           $(DTWIDGETS_LIB) \
  225.           $(XFE_WIDGETS_LIB) \
  226.           $(DIST)/lib/libxlate.a \
  227.           $(DIST)/lib/lib$(LITE_PREFIX)net.a \
  228.           $(DIST)/lib/lib$(LITE_PREFIX)rdf.a \
  229.           $(DIST)/lib/lib$(LITE_PREFIX)xml.a \
  230.           $(DIST)/lib/lib$(LITE_PREFIX)lay.a \
  231.           $(DIST)/lib/libpng.a \
  232.           $(DIST)/lib/libmariner.a \
  233.           $(DIST)/lib/libimg.a \
  234.           $(NULL)
  235.  
  236. ifdef MOZ_LOC_INDEP
  237. BASIC_LIBS    += $(DIST)/lib/libli.a
  238. endif
  239.  
  240. ifdef MOZ_JAVA
  241. JAVA_JMC = $(DIST)/lib/libjmc.a
  242. endif
  243.  
  244. BASIC_LIBS    += \
  245.           $(DIST)/lib/libpng.a \
  246.           $(JAVA_JMC) \
  247.           $(DIST)/lib/libjpeg.a \
  248.           $(DIST)/lib/libhook.a \
  249.           $(DIST)/lib/libparse.a \
  250.           $(DIST)/lib/lib$(LITE_PREFIX)pref.a \
  251.           $(DIST)/lib/lib$(LITE_PREFIX)i18n.a \
  252.           $(DIST)/lib/libpics.a \
  253.           $(DIST)/lib/libpwcac.a \
  254.           $(DIST)/lib/libreg.a \
  255.           $(NULL)
  256.  
  257. BASIC_LIBS_2    = $(DIST)/lib/lib$(LITE_PREFIX)xp.a $(DIST)/lib/libdbm.a
  258.  
  259. ifdef MOZ_MAIL_NEWS
  260. BASIC_LIBS    += \
  261.           $(DIST)/lib/libmsg.a \
  262.           $(DIST)/lib/libnet.a \
  263.           $(NULL)
  264. endif
  265.  
  266. BASIC_LIBS    += \
  267.           $(DIST)/lib/libmisc.a \
  268.           $(NULL)
  269.  
  270. ifdef MOZ_MAIL_NEWS
  271. BASIC_LIBS    += \
  272.           $(DIST)/lib/libaddr.a \
  273.           $(NULL)
  274. endif
  275.  
  276. ifdef MOZ_NEO
  277. BASIC_LIBS    += \
  278.           $(DIST)/lib/libneo.a \
  279.           $(NULL)
  280. endif
  281.  
  282. ifdef MOZ_MAIL_NEWS
  283. BASIC_LIBS    += \
  284.           $(DIST)/lib/libmime.a \
  285.           $(NULL)
  286. endif
  287.  
  288. BASIC_LIBS    += \
  289.           $(DIST)/lib/lib$(LITE_PREFIX)plug.a \
  290.           $(DIST)/lib/libutil.a \
  291.           $(DIST)/lib/libfont.a \
  292.           $(DIST)/lib/libprgrss.a \
  293.           $(NULL)
  294.  
  295. ifndef NO_LAYERS
  296. BASIC_LIBS    += $(DIST)/lib/liblayer.a
  297. endif
  298.  
  299. ifdef MOZ_JAVA
  300.  
  301. BASIC_LIBS    += \
  302.           $(DIST)/lib/lib$(LITE_PREFIX)applet.a \
  303.           $(DIST)/lib/libjrt.a \
  304.           $(DIST)/lib/libjmd.a \
  305.           $(NULL)
  306.  
  307. ifdef EDITOR
  308. BASIC_LIBS    += $(DIST)/lib/libedtplug.a
  309. endif
  310.  
  311. BASIC_LIBS    += \
  312.           $(DIST)/lib/libnsn.a \
  313.           $(DIST)/lib/libnsc.a \
  314.           $(DIST)/lib/libjpw.a \
  315.           $(DIST)/lib/libzpw.a \
  316.           $(DIST)/lib/libiawt.a \
  317.           $(DIST)/lib/libmmedia.a \
  318.           $(DIST)/lib/libsoftupdate.a \
  319.           $(DIST)/lib/libcon.a \
  320.           $(DIST)/lib/libjbn.a \
  321.           $(NULL)
  322.  
  323. ifndef NO_SECURITY
  324. BASIC_LIBS    += $(DIST)/lib/libjsl.a
  325. endif
  326.  
  327. ifdef MOZ_MAIL_NEWS
  328. BASIC_LIBS    += $(DIST)/lib/libjsl.a
  329. endif
  330.  
  331. BASIC_LIBS    += $(DIST)/lib/libjrt.a
  332.  
  333. else  # MOZ_JAVA
  334.  
  335. BASIC_LIBS    += \
  336.           $(DIST)/lib/libstubsj.a \
  337.           $(DIST)/lib/libstubnj.a \
  338.           $(NULL)
  339.  
  340. endif  # MOZ_JAVA
  341.  
  342. BASIC_LIBS    += $(DIST)/lib/libzlib.a
  343.  
  344. ifndef NO_MOCHA
  345. BASIC_LIBS    += $(DIST)/lib/libjs.a $(DIST)/lib/libjsj.a $(DIST)/lib/libmocha.a
  346. endif
  347.  
  348. # Post-Java libs
  349. BASIC_LIBS    += $(DIST)/lib/libstyle.a
  350.  
  351. ifndef NO_SECURITY
  352. BASIC_LIBS    += $(DIST)/lib/libjar.a
  353. else
  354. EXPORT_LIB    = $(DIST)/lib/libhtmldlgs.a $(DIST)/lib/libsecfree.a
  355. endif
  356.  
  357. ifdef MOZ_LDAP
  358. BASIC_LIBS    += $(DIST)/lib/libldap.a $(DIST)/lib/liblber.a 
  359. endif
  360.  
  361. LOCALES        = $(LOCALE_MAP) $(MAIL_IM_HACK) $(NEWS_IM_HACK)
  362.  
  363. ALL_EXPORT_LIBS    = $(BASIC_LIBS) $(EXPORT_LIB) $(BASIC_LIBS_2) $(NSPR_LIB)
  364.  
  365. ALL_EXPORT_DSOS    = $(ALL_EXPORT_LIBS:$(DIST)/lib/lib%.a=-l%)
  366. PLUGIN_DSO    = $(DIST)/bin/libnullplugin.so
  367. #
  368. # WEBFONT dso is not in the OFFICAL build yet. It needs to be hooked in
  369. # from the private tree
  370. #
  371. WEBFONT_DSO    =
  372.  
  373. ifdef BUILD_UNIX_PLUGINS
  374. TEST_PLUGIN    = $(DIST)/bin/libtextplugin.so
  375. endif
  376.  
  377. ifdef MKSHLIB
  378. ifndef NO_NETSCAPE_SHARED
  379. ifndef NO_BUILD_EXPORT
  380. TARGETS        += $(OBJDIR)/$(DSO_PROGNAME)-export
  381. endif
  382. endif
  383. endif
  384.  
  385. ifndef NO_NETSCAPE_STATIC
  386. ifndef NO_BUILD_EXPORT
  387. TARGETS        += $(OBJDIR)/$(XFE_PROGNAME)-export
  388. endif
  389. endif
  390.  
  391. X_OBJS        = $(OBJDIR)/$(LITE_PREFIX)config-YYY.o \
  392.           $(OBJDIR)/license.o \
  393.           $(OBJDIR)/resources-YYY.o
  394.  
  395. EXPORT_OBJS    = $(subst YYY,export,$(X_OBJS))
  396. NIS_EXPORT_OBJS    = $(subst YYY,nis-export,$(X_OBJS))
  397.  
  398. # If the version number changes, all these need to be rebuilt.
  399. # (config-* doesn't need to be in here, since that already has a rule.)
  400. VERSION_OBJS    = $(OBJDIR)/license.o \
  401.           $(OBJDIR)/resources-export.o \
  402.           $(OBJDIR)/resources-nis-export.o
  403.  
  404. #######################################################################
  405.  
  406. -include $(XFEPRIVDIR)Netscape.mk
  407. include $(DEPTH)/config/rules.mk
  408.  
  409. NS_RULES_MK    = 1
  410. -include $(XFEPRIVDIR)Netscape.mk
  411.  
  412. DEFINES        += -DNEW_DECODERS
  413.  
  414. ifdef USE_3PANE
  415. DEFINES        += -DUSE_3PANE
  416. endif
  417.  
  418. ifdef USE_ABCOM
  419. DEFINES        += -DUSE_ABCOM
  420. endif
  421.  
  422. INCLUDES    += -Isrc -I.
  423.  
  424.  
  425. #######################################################################
  426. #
  427. # Set defaults for all platforms.  Each OS_ARCH will override this if
  428. # necessary.
  429. #
  430.  
  431. #
  432. # Developers won't need libTrueDoc.so.  No point having a dependency
  433. # on this when only official builds (release builds) need this.
  434. #
  435. ifndef BUILD_OFFICIAL
  436. NO_WEBFONTS    = 1
  437. endif
  438.  
  439. # Only SunOS4 needs two versions NIS and DNS.
  440. NIS_SRC        =
  441. NIS_OBJS    =
  442. NIS_LIB        =
  443. DNS_LIB        =
  444.  
  445. # Only SunOS4 needs separate YP versions.
  446. NEED_YP_VERSION    = 0
  447.  
  448. # Only BSDI, Linux, and SunOS4 need the nls directory.
  449. NEED_NLS    = 0
  450.  
  451. # Only SunOS5 (Solaris) has MCS.
  452. MCS_CMD        = true
  453.  
  454. # Only IRIX 5.x uses this.
  455. EXTRA_POST_LINK_CMD    = echo
  456.  
  457. EXPORT_LDFLAGS    = $(BASIC_LIBS) $(EXPORT_LIB) $(BASIC_LIBS_2) $(OTHER_LIBS) $(NSPR_LIB)
  458. EXPORT_DEPLIBS    = $(BASIC_LIBS) $(EXPORT_LIB) $(BASIC_LIBS_2) $(NSPR_LIB)
  459.  
  460. DSO_EX_LIBS    = $(EXPORT_LDFLAGS:$(DIST)/lib/lib%.a=-l%)
  461.  
  462. #######################################################################
  463. #
  464. # Adjust build based on OS_ARCH.
  465. #
  466.  
  467. ########################################
  468. # IBM Machines
  469. ifeq ($(OS_ARCH),AIX)
  470. CCLD        = svxlC -+
  471. #LDFLAGS        = -bGhooksyslibs -bGlibpathexec -bGnoproc
  472. LDFLAGS        =  -bGnoproc
  473. OTHER_LIBS    = $(MOTIFLIB) -lXt -lXmu -lX11 $(OS_LIBS)
  474. US_LDFLAGS    += $(AIX_NSPR_LINK)
  475. EXPORT_LDFLAGS    += $(AIX_NSPR_LINK)
  476. FRANCE_LDFLAGS    += $(AIX_NSPR_LINK)
  477. EXTRA_REL_FILES    += $(AIX_NSPR)
  478.  
  479. ifndef NO_WEBFONTS
  480. EXTRA_REL_FILES += $(WEBFONT_DSO)
  481. endif
  482.  
  483. endif
  484.  
  485. ########################################
  486. # FreeBSD
  487. ifeq ($(OS_ARCH),FreeBSD)
  488. OTHER_LIBS    = /usr/X11R6/lib/libXm.a -L/usr/X11R6/lib -lXt -lXmu -lXext -lX11 -lSM -lICE -lm $(OS_LIBS)
  489. endif
  490.  
  491. ########################################
  492. # BSDI
  493. ifeq ($(OS_ARCH),BSD_OS)
  494. OTHER_LIBS    = $(MOTIF)/libXm.a $(LOC_LIB_DIR)/libXt.a $(X11R6LIBS) $(LOC_LIB_DIR)/libXmu.a \
  495.           $(LOC_LIB_DIR)/libXext.a $(LOC_LIB_DIR)/libX11.a -lm $(OS_LIBS)
  496.  
  497. ifeq ($(OS_RELEASE),2.1)
  498. X11R6LIBS    = $(LOC_LIB_DIR)/libSM.a $(LOC_LIB_DIR)/libICE.a
  499. OTHER_LIBS    += -lipc
  500. endif
  501.  
  502. NEED_NLS    = 1
  503.  
  504. endif
  505.  
  506. ########################################
  507. # HP Machines
  508. ifeq ($(OS_ARCH),HP-UX)
  509.  
  510. ifeq ($(OS_RELEASE),B.10)
  511. INCLUDES    += -I.
  512. endif
  513.  
  514. HPUX_RESOURCE_HACK    = -Wp,-H16384
  515.  
  516. OTHER_LIBS    = -L/usr/lib/X11R5 -L/usr/lib/Motif1.2 -lXm -L$(DIST)/lib -lXmu -lXt -lX11 -lXext $(OS_LIBS)
  517.  
  518. ifndef NO_EDITOR
  519. EXPORT_DEPLIBS    += cxxlink-filter
  520. US_DEPLIBS    += cxxlink-filter
  521. CCLD        = CC -tl,./cxxlink-filter
  522.  
  523. ifndef NO_WEBFONTS
  524. EXTRA_REL_FILES    += $(WEBFONT_DSO)
  525. endif
  526.  
  527. #
  528. # On HP, enable SHLIB_PATH
  529. #
  530. EXTRA_POST_LINK_CMD    = chatr +s enable
  531.  
  532. endif
  533.  
  534. endif
  535.  
  536. ########################################
  537. # SGI Machines
  538. ifeq ($(OS_ARCH),IRIX)
  539.  
  540. #
  541. # Linker will report that '-lSgm' does not resolve any symbols, but it
  542. # should not be removed. SGI dynamically opens the library depending on
  543. # the setting of some resources (e.g. "useEnhancedFSB")
  544. #
  545. OTHER_LIBS    = -lSgm $(MOTIFPATCH_LIB) -lXm -lXmu -lXt -lX11 -lXext -lgen -laudio -lm $(OS_LIBS)
  546.  
  547. #
  548. # On Irix, tag the executable for use by the Indigo Magic Desktop.
  549. # This magic number comes from /usr/lib/filetype/install/netscape.ftr
  550. # shipped by SGI along with their n.nnS version of Mozilla.
  551. #
  552. ifeq ($(OS_RELEASE),5)
  553. EXTRA_POST_LINK_CMD    = /usr/sbin/tag 67150
  554. endif
  555.  
  556. #
  557. # If we are using gtscc, we must use it as the linker, and we
  558. # can only build statically (no shared libs).
  559. #
  560. CCLD        = CC
  561. ifdef USE_GTSCC
  562. ifndef NO_GTSCC
  563. CCLD        = $(DIST)/bin/gtscc $(GTSCC_LD_OPTIONS) -gtsfile $(DEPTH)/config/$(OBJDIR)/db.gts -gtsrootdir $(DEPTH)
  564. TARGETS        = $(OBJDIR)/$(XFE_PROGNAME)-export
  565. endif
  566. endif
  567.  
  568. ifndef NO_WEBFONTS
  569. EXTRA_REL_FILES += $(WEBFONT_DSO)
  570. endif
  571.  
  572. endif
  573.  
  574. ########################################
  575. # Linux
  576. ifeq ($(OS_ARCH),Linux)
  577.  
  578. # Some linux platforms (there's so many of them) need special defines
  579. # for different versions of motif.  Right now the only significant 
  580. # define is NS_MOTIF2_XP_LD_FLAGS (-lXp needed for motif 2.x)
  581. #
  582. # The file motif.mk holds such defines.
  583. -include $(DEPTH)/config/motif.mk
  584.  
  585. XTOOLLIB    = -L/usr/X11R6/lib -lXt -lSM -lICE
  586. XLIB        = -lXext -lX11
  587. XMULIB        = -lXmu -lXpm
  588.  
  589. ifeq ($(OS_RELEASE),2.0)
  590. ifeq ($(CPU_ARCH),ppc)
  591. MOTIFLIB    = /usr/local/lib/libXm.a
  592. else
  593.  
  594. MOTIFLIB    =\
  595.             $(MOTIFPATCH_LIB) \
  596.             /usr/X11R6/lib/libXm.a \
  597.             $(NS_MOTIF2_XP_LD_FLAGS)
  598.  
  599. endif
  600. else
  601. MOTIFLIB    = /usr/X11R6/lib/libXm.a
  602. endif
  603.  
  604. OTHER_LIBS    = $(MOTIFLIB) $(XTOOLLIB) $(XMULIB) $(EXTENSIONLIB) $(XLIB) /usr/lib/libm.a -ldl
  605.  
  606. #
  607. # This assumes there is a libXm.so on the system.  If there isn't, you'll
  608. # get two identical binaries.
  609. #
  610. ifeq ($(OS_RELEASE)$(CPU_ARCH),2.0x86)
  611. DYN_MOTIFLIB    = $(MOTIFPATCH_LIB) -lXm $(NS_MOTIF2_XP_LD_FLAGS)
  612.  
  613. EXTRA_EXPORT_OBJS    = $(OBJDIR)/$(XFE_PROGNAME)-motif-export
  614. EXTRA_EXPORT_BINARY    = $(EXTRA_EXPORT_OBJS)
  615.  
  616. PLUGIN_DSO    += $(DIST)/bin/libnullplugin-dynMotif.so
  617.  
  618. ifndef NO_WEBFONTS
  619. EXTRA_REL_FILES += $(WEBFONT_DSO)
  620. endif
  621.  
  622. endif
  623.  
  624. EXPORT_LDFLAGS    += -lc
  625.  
  626. endif
  627.  
  628. ########################################
  629. # NCR SYSV 4.0
  630. ifeq ($(OS_ARCH),NCR)
  631. OTHER_LIBS    = -L/usr/X/lib $(MOTIFLIB) -lXt -lXmu -lXext -lX11 -lgen -lm $(OS_LIBS)
  632. endif
  633.  
  634. ########################################
  635. # NEC SYSV 4.2
  636. ifeq ($(OS_ARCH),NEC)
  637. OTHER_LIBS    = -L/usr/abiccs/lib/X11R5 $(MOTIFLIB) -lXt -lXmu -lXext -lX11 -lresolv -lgen -lm $(OS_LIBS)
  638. endif
  639.  
  640. ########################################
  641. # Dec Machines
  642. ifeq ($(OS_ARCH),OSF1)
  643.  
  644. #
  645. # We would like to link OSF1 static.
  646. # This is because of motif problems (BadMatch errors on non-default visual)
  647. # on 3.2 and 3.0 (and not on 2.0).
  648. # But libX11 needs to be dynamic, otherwise the locale stuff doesn't work
  649. # and you get warnings and core dump when pasting into Mozilla.
  650. # Also, libXm must be dynamic, otherwise Japanese text widgets hang
  651. # the process.
  652. OTHER_LIBS    = -lXm -lXmu -lXt -lX11 -lXext -ldnet_stub -lm -lots $(OS_LIBS)
  653.  
  654. EXPORT_LDFLAGS    = $(BASIC_LIBS) $(EXPORT_LIB) $(BASIC_LIBS_2) $(NSPR_LIB) $(OTHER_LIBS)
  655.  
  656. endif
  657.  
  658. ########################################
  659. # SNI ReliantUNIX (SINIX)
  660. ifeq ($(OS_ARCH),SINIX)
  661. OTHER_LIBS    = -lXm -lXmu -lXt -lX11 -lXext $(OS_LIBS)
  662. endif
  663.  
  664. ########################################
  665. # SCO OpenServer
  666. ifeq ($(OS_ARCH),SCOOS)
  667. OTHER_LIBS    = $(LIB_XMOS) -lXm -lXt -lXmu -lXext -lX11 -lm -lPW $(OS_LIBS)
  668.  
  669. ifdef NEED_XMOS
  670. LIB_XMOS    = $(OBJDIR)/Xmos.o
  671. endif
  672.  
  673. endif
  674.  
  675. ########################################
  676. # Sun Machines
  677. ifeq ($(OS_ARCH),SunOS)
  678.  
  679. ifeq ($(OS_RELEASE),4.1)
  680.  
  681. ALL_TARGETS    += $(OBJDIR)/$(XFE_PROGNAME)-nis-export
  682.  
  683. OTHER_LIBS    = -L$(MOTIF)/lib $(MOTIF)/lib/libXm.a $(MOTIF)/lib/libXmu.a $(MOTIF)/lib/libXt.a \
  684.           $(MOTIF)/lib/libXext.a $(MOTIF)/lib/libX11.a
  685.  
  686. ifndef NO_WEBFONTS
  687. EXTRA_REL_FILES += $(WEBFONT_DSO)
  688. endif
  689.  
  690. ifndef NO_EDITOR
  691. OTHER_LIBS    += -L$(NS_LIB)
  692.  
  693. #
  694. # Need this guy because the one in libg++.a is (still?) broken.
  695. #
  696. BASIC_LIBS    += $(OBJDIR)/regex.o
  697. $(OBJDIR)/regex.o:    /lib/libc.a
  698.     ar x /lib/libc.a regex.o && mv regex.o $@
  699. endif
  700.  
  701. #
  702. # Need our own popen to fix the SunOS popen problem.
  703. #
  704. BASIC_LIBS    += $(OBJDIR)/popen.o
  705. CSRCS        += popen.c
  706.  
  707. EXPORT_LDFLAGS    += -lm
  708.  
  709. # SunOS had 2 executables. Only the non-nis version need this
  710. NIS_OBJS    = $(OBJDIR)/dns-stub.o
  711. NIS_SRCS    = dns-stub.c
  712. NIS_LIB        = $(NIS_OBJS)
  713. DNS_LIB        = -lresolv
  714.  
  715. # For release only.
  716. # This is only for SunOS as it has both nis and non-nis
  717. # version of the browser packaged together.
  718. EXTRA_EXPORT_OBJS    = $(XFE_PROGNAME)-nis-export
  719.  
  720. NEED_YP_VERSION    = 1
  721. NEED_NLS    = 1
  722.  
  723. endif
  724.  
  725. ########################################
  726. ifneq (,$(filter 5 5.5,$(OS_RELEASE)))
  727.  
  728. USRLIBDIR    := /usr/openwin/lib
  729. MCS_CMD        = mcs -d
  730.  
  731. ifeq ($(CPU_ARCH),sparc)
  732. OTHER_LIBS    = $(MOTIFPATCH_LIB) $(MOTIFLIB) -lXt -lXmu -lXext -lX11 $(OS_LIBS) -lgen -lresolv -lm
  733. ifndef NO_WEBFONTS
  734. EXTRA_REL_FILES += $(WEBFONT_DSO)
  735. endif
  736. else
  737. OTHER_LIBS    = $(MOTIFLIB) -lXt -lXmu -lXext -lX11 $(OS_LIBS) -lm
  738. LDFLAGS        = $(NOMD_CFLAGS)
  739. endif
  740.  
  741. EXPORT_LDFLAGS    = -z defs -L$(MOTIF)/lib -L$(USRLIBDIR) -R$(MOTIF)/lib \
  742.           -R$(USRLIBDIR) $(BASIC_LIBS) $(EXPORT_LIB) $(BASIC_LIBS_2) \
  743.           $(OTHER_LIBS) $(NSPR_LIB)
  744.  
  745. endif
  746. endif
  747.  
  748. ########################################
  749. # SCO Unixware 2.1
  750. ifeq ($(OS_ARCH),UNIXWARE)
  751.  
  752. ifdef NEED_XMOS
  753. LIB_XMOS    = $(OBJDIR)/Xmos.o
  754. endif
  755.  
  756. OTHER_LIBS    = $(LIB_XMOS) -L/usr/X/lib -lXm -lXt -lXmu -lXext -lX11 -lm
  757.  
  758. EXPORT_LDFLAGS    += -lresolv -lsocket -lc /usr/ucblib/libucb.a
  759.  
  760. endif
  761.  
  762. #######################################################################
  763.  
  764. $(MICROLINE_LIB):
  765.     cd Microline3.0/XmL; $(MAKE)
  766.  
  767. $(ICONS_LIB):
  768.     cd icons; $(MAKE)
  769.  
  770. $(COMBOBOX_LIB):
  771.     cd combobox; $(MAKE)
  772.  
  773. $(DTWIDGETS_LIB):
  774.     cd DtWidgets; $(MAKE)
  775.  
  776. $(XFE_WIDGETS_LIB):
  777.     cd XfeWidgets/Xfe; $(MAKE)
  778.  
  779. $(XFE2_LIB):
  780.     cd src; $(MAKE)
  781.  
  782. $(TARGETS): $(OBJS)
  783.  
  784. #######################################################################
  785. # Rules to build license.o files
  786.  
  787. $(OBJDIR)/license.o: $(OBJDIR)/LICENSE.c Makefile
  788.     $(CC) -c -o $@ $<
  789.  
  790. ifndef NETSCAPE_MK
  791. $(OBJDIR)/LICENSE.c:
  792.     @echo 'const char fe_LicenseData[] = "This license intentionally left blank.";' > $@
  793. endif
  794.  
  795. #######################################################################
  796. # Rules to build config*.o files
  797.  
  798. $(OBJDIR)/$(LITE_PREFIX)config-export.o: config.c versionn.h Makefile $(OBJS) $(EXPORT_DEPLIBS)
  799.     @echo Generating $@ from config.c...;                      \
  800.     X=' ';                                      \
  801.     VN=`sed -n$$X 's/^#define VERSION_NUMBER[     ]*\(.*\)$$/\1/p' versionn.h` ; \
  802.     $(CC) -c $(CFLAGS) -o $@ config.c                      \
  803.         -DCONFIG="$(GUESS_CONFIG)"                      \
  804.         -DDATE="`date +%d-%h-%y`"                      \
  805.         -DVERSION=$${VN}                          \
  806.         -UHAVE_NIS -UFRANCE_VERSION -DEXPORT_VERSION -UUS_VERSION -UVENDOR_ANIM
  807.  
  808. $(OBJDIR)/$(LITE_PREFIX)config-nis-export.o: config.c versionn.h Makefile $(OBJS) $(NIS_OBJS) $(EXPORT_DEPLIBS)
  809.     @echo Generating $@ from config.c...;                      \
  810.     X=' ';                                      \
  811.     VN=`sed -n$$X 's/^#define VERSION_NUMBER[     ]*\(.*\)$$/\1/p' versionn.h` ; \
  812.     $(CC) -c $(CFLAGS) -o $@ config.c                      \
  813.         -DCONFIG="$(GUESS_CONFIG)"                      \
  814.         -DDATE="`date +%d-%h-%y`"                      \
  815.         -DVERSION=$${VN}                          \
  816.         -DHAVE_NIS -UFRANCE_VERSION -DEXPORT_VERSION -UUS_VERSION -UVENDOR_ANIM
  817.  
  818. #######################################################################
  819. # Rules to build resources
  820.  
  821. .SUFFIXES: .ad
  822.  
  823. # DO NOT CHANGE THE ORDER OF THE DEPENDENCIES.  Add new ones to the end.
  824. resources-%.o: RESOURCES-%.c Makefile
  825.     $(CC) -c $(HPUX_RESOURCE_HACK) -o $@ $<
  826.  
  827. RESOURCES-%.c: Netscape-%.ad ad2c Makefile
  828.     @echo 'char *fe_fallbackResources[] = {' > $@; \
  829.     ./ad2c $< >> $@; \
  830.     echo '0};' >> $@
  831.  
  832. # Explicit dependency list to ensure that e_kit_resources.h gets built.
  833. $(OBJDIR)/e_kit.o:    e_kit.c e_kit_resources.h
  834.  
  835. # Turn ekit app-defaults into a C file
  836. e_kit_resources.h: e_kit.ad
  837.     @echo 'char* fe_ekitDefaultDatabase = ' > $@
  838.     cat $< | tr '[\001-\272]' '[\106-\377]' | \
  839.         od -b | sed 's/^[0-7][0-7]* *\(.*\)/\\\1/; \
  840.         s/ /\\/g;s/\(.*\)/ "\1"/;s/^ *"\\"$$//' >> $@
  841.     @echo ';' >> $@
  842.  
  843. $(OBJDIR)/Netscape-nis-export.ad $(OBJDIR)/Netscape-export.ad: Makefile resources versionn.h strs make-resources $(LOCALE_MAP)
  844.     @./make-resources $@ Netscape Netscape "" export $(LOCALES)
  845.  
  846. #######################################################################
  847. # The "-export" targets
  848.  
  849. $(OBJDIR)/$(DSO_PROGNAME)-export: $(OBJS) $(EXPORT_OBJS) $(EXPORT_DEPLIBS)
  850.     @$(MAKE_OBJDIR)
  851.     rm -f $@
  852.     $(CCLD) -o $@ $(LDFLAGS) $(OBJS) $(EXPORT_OBJS) -L$(DIST)/bin -L$(DIST)/lib $(DSO_EX_LIBS) $(DNS_LIB)
  853.     @$(EXTRA_POST_LINK_CMD) $@
  854.  
  855. $(OBJDIR)/$(DSO_PROGNAME)-export.mcv: $(OBJS) $(EXPORT_OBJS) $(EXPORT_DEPLIBS)
  856.     @$(MAKE_OBJDIR)
  857.     rm -f $@
  858.     $(CCLD) -o $@ $(CFLAGS) $(OBJS) $(EXPORT_OBJS) -L$(DIST)/bin -L$(DIST)/lib $(DSO_EX_LIBS) $(DNS_LIB) -lmalloc_cv
  859.     @$(EXTRA_POST_LINK_CMD) $@
  860.  
  861. $(OBJDIR)/$(DSO_PROGNAME)-export.pure: $(OBJS) $(EXPORT_OBJS) $(EXPORT_DEPLIBS)
  862.     @$(MAKE_OBJDIR)
  863.     rm -f $@
  864.     $(PURIFY) $(CCLD) -o $@ $(LDFLAGS) $(OBJS) $(EXPORT_OBJS) -L$(DIST)/bin -L$(DIST)/lib $(DSO_EX_LIBS) $(DNS_LIB)
  865.     @$(EXTRA_POST_LINK_CMD) $@
  866.  
  867. $(OBJDIR)/$(DSO_PROGNAME)-export.quantify: $(OBJS) $(EXPORT_OBJS) $(EXPORT_DEPLIBS)
  868.     @$(MAKE_OBJDIR)
  869.     rm -f $@
  870.     $(QUANTIFY) $(CCLD) -o $@ $(LDFLAGS) $(OBJS) $(EXPORT_OBJS) -L$(DIST)/bin -L$(DIST)/lib $(DSO_EX_LIBS) $(DNS_LIB)
  871.     @$(EXTRA_POST_LINK_CMD) $@
  872.  
  873. $(OBJDIR)/$(XFE_PROGNAME)-export: $(OBJS) $(EXPORT_OBJS) $(EXPORT_DEPLIBS)
  874.     @$(MAKE_OBJDIR)
  875.     rm -f $@
  876.     $(CCLD) -o $@ $(LDFLAGS) $(OBJS) $(EXPORT_OBJS) $(EXPORT_LDFLAGS) $(DNS_LIB)
  877.     @$(EXTRA_POST_LINK_CMD) $@
  878.  
  879. $(OBJDIR)/$(XFE_PROGNAME)-export.pure: $(OBJS) $(EXPORT_OBJS) $(EXPORT_DEPLIBS)
  880.     @$(MAKE_OBJDIR)
  881.     rm -f $@
  882.     $(PURIFY) $(CCLD) -o $@ $(NOMD_LDFLAGS) $(OBJS) $(EXPORT_OBJS) $(EXPORT_LDFLAGS) $(DNS_LIB)
  883.     @$(EXTRA_POST_LINK_CMD) $@
  884.  
  885. $(OBJDIR)/$(XFE_PROGNAME)-export.quantify: $(OBJS) $(EXPORT_OBJS) $(EXPORT_DEPLIBS)
  886.     @$(MAKE_OBJDIR)
  887.     rm -f $@
  888.     $(QUANTIFY) $(CCLD) -o $@ $(NOMD_LDFLAGS) $(OBJS) $(EXPORT_OBJS) $(EXPORT_LDFLAGS) $(DNS_LIB)
  889.     @$(EXTRA_POST_LINK_CMD) $@
  890.  
  891. $(OBJDIR)/$(XFE_PROGNAME)-export.prof: $(OBJS) $(EXPORT_OBJS) $(EXPORT_DEPLIBS)
  892.     @$(MAKE_OBJDIR)
  893.     rm -f $@
  894.     $(CCLD) -p -o $@ $(LDFLAGS) $(OBJS) $(EXPORT_OBJS) $(EXPORT_LDFLAGS) $(DNS_LIB)
  895.     @$(EXTRA_POST_LINK_CMD) $@
  896.  
  897. $(OBJDIR)/$(XFE_PROGNAME)-nis-export: $(OBJS) $(NIS_EXPORT_OBJS) $(NIS_OBJS) $(EXPORT_DEPLIBS)
  898.     @$(MAKE_OBJDIR)
  899.     rm -f $@
  900.     $(CCLD) -o $@ $(LDFLAGS) $(OBJS) $(NIS_EXPORT_OBJS) $(EXPORT_LDFLAGS) $(NIS_LIB)
  901.     @$(EXTRA_POST_LINK_CMD) $@
  902.  
  903. #
  904. # Build a dynamic Motif version.
  905. #
  906. ifeq ($(OS_ARCH)$(OS_RELEASE)$(CPU_ARCH),Linux2.0x86)
  907.  
  908. $(OBJDIR)/$(XFE_PROGNAME)-motif-export: $(OBJS) $(EXPORT_OBJS) $(EXPORT_DEPLIBS)
  909.     @$(MAKE_OBJDIR)
  910.     rm -f $@
  911.     $(CCLD) -o $@ $(LDFLAGS) $(OBJS) $(EXPORT_OBJS) $(BASIC_LIBS) $(EXPORT_LIB) $(BASIC_LIBS_2) -L/usr/X11R6/lib $(DYN_MOTIFLIB) -lXt -lSM -lICE $(XMULIB) $(EXTENSIONLIB) $(XLIB) /usr/lib/libm.a -ldl $(NSPR_LIB) $(DNS_LIB) -lc
  912.     @$(EXTRA_POST_LINK_CMD) $@
  913. endif
  914.  
  915. #---------------- Misc link targets follow ----------------------#
  916.  
  917. # Make a dynamic export executable using malloc_cv by default.
  918. mcv:    $(OBJDIR)/$(DSO_PROGNAME)-export $(OBJDIR)/$(DSO_PROGNAME)-export.mcv
  919.  
  920. # Make a purified, static export executable by default.
  921. pure:    $(OBJDIR)/$(XFE_PROGNAME)-export $(OBJDIR)/$(XFE_PROGNAME)-export.pure
  922.  
  923. # Trying out quantify.
  924. quantify:    $(OBJDIR)/$(XFE_PROGNAME)-export $(OBJDIR)/$(XFE_PROGNAME)-export.quantify
  925.  
  926. # Use gtscc to find dead code globals.
  927. unreferenced: $(OBJS) $(NET_EXPORT_OBJS) $(BASIC_LIBS) $(EXPORT_LIB) $(BASIC_LIBS_2) $(NSPR_LIB) $(DIST)/bin/gtscc 
  928.     @$(MAKE_OBJDIR)
  929.     rm -f $@
  930.     $(DIST)/bin/gtscc -gtsrootdir $(DEPTH) -gtsdump -gtsnorecompile -gtsnolink $(DEPTH) $(OBJS) $(NET_EXPORT_OBJS) $(BASIC_LIBS) $(EXPORT_LIB) $(BASIC_LIBS_2) $(NSPR_LIB) | awk -n '/ 0 0 / { print $$5 " " $$1 }' | sort > $@
  931.  
  932. # Some dependencies that -MDupdate isn't getting.
  933. $(OBJDIR)/strids.o:    xfe_err.h
  934. $(OBJDIR)/strings.o:    xfe_err.h
  935.  
  936. ifeq ($(OS_ARCH),AIX)
  937. AIX_HACK    := $(notdir $(AIX_NSPR))
  938.  
  939. # Install nspr dynamic library for AIX.
  940. $(AIX_HACK): $(AIX_NSPR)
  941.     $(INSTALL) -m 644 $< .
  942. endif
  943.  
  944. install:: $(AIX_HACK) $(EXTRA_REL_FILES) $(TARGETS)
  945. ifdef TARGETS
  946.     $(INSTALL) $(TARGETS) $(DIST)/bin
  947. endif
  948.  
  949. $(VERSION_OBJS): versionn.h
  950.  
  951. #
  952. # For some reason the -include's in this file aren't working,
  953. # so until I figure it out, if Netscape.mk doesn't exist, just
  954. # create a dummy file. --briano
  955. #
  956. $(XFEPRIVDIR)Netscape.mk:
  957. ifdef XFEPRIVDIR
  958.     @-mkdir -p $(XFEPRIVDIR)
  959. endif
  960.     @touch $@
  961.  
  962. everything:    all $(ALL_TARGETS)
  963.  
  964. symbols:
  965.     @echo "ALL_TARGETS = $(ALL_TARGETS)"
  966.     @echo "RELEASES    = $(RELEASES)"
  967.     @echo "OS_ARCH     = $(OS_ARCH)"
  968.