1 # $Id: Makefile.generic,v 1.11 2003/11/22 13:03:39 edg Exp $
2 #
3 # Prototype System-Specific Makefile for NEdit
4 #
5 # NEdit does not use any kind of automated configuration like the popular GNU
6 # configure utility, or Imake. Instead, it has a set of hand-generated
7 # system-specific Makefiles. The Makefiles serve two purposes. The obvious
8 # purpose is to build NEdit. The less obvious purpose is to document on which
9 # systems effort has been put into verifying that NEdit actually works properly.
10 # If your system is not represented here, check the nedit web site at:
11 # http://nedit.org for more contributed Makefiles.
12 #
13 # NEdit has few dependencies, and sticks to Posix and ANSI C standards wherever
14 # possible. The only problems people generally run in to in porting NEdit are
15 # related to the Motif GUI library. If you're having trouble building NEdit,
16 # usually the best way to get it to work is to look at any other Motif, or at
17 # least X example which builds and runs successfully, and copy the compiler
18 # flags and libraries that it uses.
19 #
20
21 # C Compiler used to build all of the C sources. This must be an
22 # ANSI standard C compiler.
23 CC=cc
24
25 # Library (archive) tool used to combine groups of object files into
26 # a single file.
27 AR=libtool
28
29 # Arguments to be passed to the C compiler.
30 #
31 # Below are compiler flags which may be of use if you are porting NEdit to a
32 # new system:
33 #
34 # DONT_HAVE_GLOB Some older systems don't have the glob subroutine for
35 # USE_MOTIF_GLOB expanding file names. If the linker complains about not
36 # finding "glob" and "globfree", first try adding:
37 # -DUSE_MOTIF_GLOB, which will use a private Motif routine
38 # in place of "glob". Being a private routine, it is not
39 # available in all Motif implementations, and you may have
40 # to resort to -DDONT_HAVE_GLOB, and NEdit will not be able
41 # to expand wildcards in the "Open Selected" command (which
42 # is no huge loss).
43 #
44 # USE_LPR_PRINT_CMD NEdit considers the standard Unix print command to be "lp"
45 # unless told otherwise. If the standard command on your
46 # system type is "lpr", define this. (This is just the last
47 # resort default. You can redefine the print command to be
48 # whatever you like via X resource settings).
49 #
50 # DONT_USE_ACCESS NEdit used to determine the accessibility of a file by
51 # trying to open it. However, one of the more popular
52 # commercial configuration management tools, ClearCase,
53 # considers opening a file in read/write mode to be a
54 # modification, even if no writing is ever done. This lead
55 # to users having trouble with ClearCase thinking their
56 # files had been modified when they hadn't. NEdit now uses
57 # access() to determine whether a file is writable (in a
58 # safe way). The old behavior can be restored by defining
59 # DONT_USE_ACCESS.
60 #
61 # ROWCOLPATCH Patches around a problem in several versions the Solaris
62 # Motif library which can cause crashes when a wiget is
63 # destroyed. See comments in window.c for details.
64 #
65 # IBM_FWRITE_BUG Killer AIX system bug with fwrite system call. Only
66 # affects one release of AIX, but can cause data corruption.
67 # IBM actually denies that this bug ever existed, but it
68 # was pretty widespread.
69 #
70 # EDITRES If you have the Xmu library, define this to give NEdit
71 # the capability of being probed by editres to display its
72 # widget tree. Editres is useful in customizing details
73 # of X applications which their developers have deemed too
74 # minute to document. If you define this, you must also add
75 # -lXmu to LIBS
76 #
77 # NO_XMIM Don't use the Motif version of the international character
78 # set input routines in the nedit text widget. Turn this on
79 # if you see crashes in routines beginning with XmIm. Such
80 # bugs exist in IRIX 6.5 and some older Motif versions.
81 #
82 # REPLACE_SCOPE Currently, two alternative (but functionally equivalent)
83 # Replace/Find dialog box layouts are available. By default,
84 # a layout with 2 rows of push buttons is built. Compiling
85 # with the REPLACE_SCOPE flag enables an alternative layout
86 # with a row of radio buttons for selecting the scope of the
87 # replace operations. Eventually, one of these alternatives
88 # will probably disappear. Please let us know which one you
89 # prefer (via the discuss mailing list, for instance).
90 #
91 # HAVE__XMVERSIONSTRING If the Motif library exports the runtime version this
92 # will display both strings in the version info to help
93 # confirm the compile time and run time versions are
94 # compatible.
95 #
96 # NO_READLINK Define if your system doesn't have the UNIX interface
97 # readlink(2) - or just no symlinks at all.
98 #
99 # HAVE_CONFIG_H Include config.h from toplevel directory in front
100 # of all other headers in each .c source file.
101 # Only useful for developers so far.
102 #
103 # HAVE_DEBUG_H Include debug.h from toplevel directory after
104 # all other headers in each .c source file.
105 # Only useful for developers.
106 #
107 # Some compilers need to be told to operate in ansi-standard mode, some have
108 # different levels of optimization that you can select (optimization improves
109 # syntax highlighting performance. You will also often need to add locations
110 # of X and/or Motif include files if they are not in the compiler's standard
111 # search path.
112
113 C_OPT_FLAGS?=-O2
114
115 ifeq ($(shell [ -d /opt/local/include/X11 ] && echo 1 || echo 0), 1)
116 CFLAGS=$(C_OPT_FLAGS) -I/opt/local/include -I/opt/local/include/X11 -I/opt/local/include/freetype2
117 else
118 CFLAGS=$(C_OPT_FLAGS) -I/usr/x11/include -I/usr/x11/include/freetype2 -I`brew --prefix`/include/
119 endif
120
121 # Flags for the library (archive) tool. These are pretty much standard
122 # across all Unix systems, but if your system is having trouble building or
123 # rebuilding the nedit library (libNUtil.a), you can try tweaking these.
124 ARFLAGS=-static -o
125
126 # A few C compilers have limits on the size of string constants, which NEdit's
127 # built-in help may exceed. Paradoxically, when you compile the code with one
128 # of these mutants, it usually tells you how to bump up the limit, so all you
129 # have to do is enter that information here.
130 BIGGER_STRINGS=
131
132 # Flags for the linker. On some systems, you have to specify the locations
133 # for the X and/or Motif libraries. There may also be additional prerequisite
134 # libraries which are required by the X and Motif libraries. These vary from
135 # system to system, and it helps to have a working Motif program (or at least
136 # an X program) as an example.
137 ifeq ($(shell [ -d /opt/local/lib/X11 ] && echo 1 || echo 0), 1)
138 LIBS= $(LD_OPT_FLAGS) -L/opt/local/lib -lXm -lXmu -lXft -lfontconfig -lXt -lX11 -lm -lXrender -ljpeg -lpng -liconv -lpthread
139 else
140 LIBS= $(LD_OPT_FLAGS) -L`brew --prefix`/lib -lXm -lXmu -lXft -lfontconfig -lXt -lX11 -lm -lXrender -ljpeg -lpng -liconv -lpthread
141 endif
142
143 # System independent part
144 include Makefile.common
145
146 verify_config:
147