1 #! gmake
2 #
3 # ***** BEGIN LICENSE BLOCK *****
4 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 #
6 # The contents of this file are subject to the Mozilla Public License Version
7 # 1.1 (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
9 # http://www.mozilla.org/MPL/
10 #
11 # Software distributed under the License is distributed on an "AS IS" basis,
12 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 # for the specific language governing rights and limitations under the
14 # License.
15 #
16 # The Original Code is the Microline Widget Library, originally made available under the NPL by Neuron Data <http://www.neurondata.com>.
17 #
18 # The Initial Developer of the Original Code is
19 # Netscape Communications Corporation.
20 # Portions created by the Initial Developer are Copyright (C) 1998
21 # the Initial Developer. All Rights Reserved.
22 #
23 # Contributor(s):
24 #
25 # Alternatively, the contents of this file may be used under the terms of
26 # either the GNU General Public License Version 2 or later (the "GPL"), or
27 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 # in which case the provisions of the GPL or the LGPL are applicable instead
29 # of those above. If you wish to allow use of your version of this file only
30 # under the terms of either the GPL or the LGPL, and not to allow others to
31 # use your version of this file under the terms of the MPL, indicate your
32 # decision by deleting the provisions above and replace them with the notice
33 # and other provisions required by the GPL or the LGPL. If you do not delete
34 # the provisions above, a recipient may use your version of this file under
35 # the terms of any one of the MPL, the GPL or the LGPL.
36 #
37 # In addition, as a special exception to the GNU GPL, the copyright holders
38 # give permission to link the code of this program with the Motif and Open
39 # Motif libraries (or with modified versions of these that use the same
40 # license), and distribute linked combinations including the two. You
41 # must obey the GNU General Public License in all respects for all of
42 # the code used other than linking with Motif/Open Motif. If you modify
43 # this file, you may extend this exception to your version of the file,
44 # but you are not obligated to do so. If you do not wish to do so,
45 # delete this exception statement from your version.
46 #
47 # ***** END LICENSE BLOCK *****
48
49
50 #
51 # This make file was copied from ns/cmd/xfe/XfeWidgets/tests/Makefile
52 # and tweaked. A lot of the rules and logic can probably be shared.
53 # Stuff should be shared in
54 #
55 #
56 DEPTH = ../../../..
57 topsrcdir = @top_srcdir@
58 VPATH = @srcdir@
59 srcdir = @srcdir@
60
61 include $(DEPTH)/config/autoconf.mk
62
63 ifdef XFE_WIDGETS_BUILD_UNUSED
64 UNUSED_CSRCS = \
65 demo.c \
66 prog1.c \
67 prog2.c \
68 prog3.c \
69 uil1.c \
70 util1.c \
71 $(NULL)
72 endif
73
74 CSRCS = \
75 $(UNUSED_CSRCS) \
76 folder1.c \
77 folder2.c \
78 folder3.c \
79 folder4.c \
80 grid1.c \
81 grid2.c \
82 grid3.c \
83 grid4.c \
84 grid5.c \
85 grid6.c \
86 tree1.c \
87 tree2.c \
88 tree3.c \
89 tree4.c \
90 tree5.c \
91 $(NULL)
92
93 REQUIRES = \
94 Microline
95
96 PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=.exe))
97
98 include $(topsrcdir)/config/rules.mk
99 include $(topsrcdir)/cmd/xfe/XfeWidgets/XfeWidgets.mk
100
101 all:: $(PROGS)
102 install:: $(PROGS)
103
104 LDFLAGS =
105
106 SHARED_XFE_LIBS = $(DIST)/bin/libXmL.$(DLL_SUFFIX)
107
108 STATIC_XFE_LIBS = $(DIST)/lib/libXmL.a
109
110 DIST_FLAGS = -L$(DIST)/bin
111
112 ifeq ($(OS_ARCH),AIX)
113
114 XFE_FLAGS = $(STATIC_XFE_LIBS)
115
116 else
117
118 XFE_FLAGS = $(SHARED_XFE_LIBS)
119
120 endif
121
122 ifeq ($(OS_ARCH),Linux)
123 -include $(DEPTH)/config/motif.mk
124 endif
125
126 XM_LD_FLAGS = -lMrm -lXm $(NS_MOTIF2_XP_LD_FLAGS)
127
128 X_LD_FLAGS = $(XM_LD_FLAGS) -lXt -lXmu -lXext -lX11
129
130 OS_BEFORE_FLAGS =
131 OS_AFTER_FLAGS =
132
133 ifeq ($(OS_ARCH),SunOS)
134
135 OS_BEFORE_LDFLAGS =\
136 -L/usr/dt/lib \
137 -L/usr/openwin/lib
138
139 OS_AFTER_LDFLAGS =\
140 -lw \
141 -lintl \
142 -lsocket \
143 -lnsl \
144 -lgen \
145 -lm \
146 -ldl
147 endif
148
149 ifeq ($(OS_ARCH),AIX)
150
151 OS_BEFORE_LDFLAGS =\
152 -L/usr/dt/lib
153 endif
154
155 ifeq ($(OS_ARCH),IRIX)
156 endif
157
158 ifeq ($(OS_ARCH),Linux)
159
160 OS_BEFORE_LDFLAGS = -L/usr/X11R6/lib
161
162 endif
163
164 ifeq ($(OS_ARCH),HP-UX)
165
166 OS_BEFORE_LDFLAGS = -L$(DIST)/bin
167
168 endif
169
170 LDFLAGS =\
171 $(OS_BEFORE_LDFLAGS) \
172 $(DIST_FLAGS) \
173 $(XFE_FLAGS) \
174 $(X_LD_FLAGS) \
175 $(OS_AFTER_LDFLAGS)
176
177 ##
178 ## Test dependancies
179 ##
180 #OTHER_DEPS = Makefile $(XFE_FLAGS)
181 OTHER_DEPS = $(XFE_FLAGS)
182
183 ##
184 ## Resource source rule
185 ##
186 #$(OBJDIR)/%.ad.c:: %.ad # Makefile
187 # @$(MAKE_OBJDIR)
188 # @echo 'char * fallback_resources[] = {' > $@; \
189 # ./ad2c $< >> $@; \
190 # echo '0};' >> $@
191
192 ##
193 ## Resource object rule
194 ##
195 #$(OBJDIR)/%.ad.o: $(OBJDIR)/%.ad.c
196 # @$(MAKE_OBJDIR)
197 # $(CC) -o $@ -c $<
198
199 ##
200 ## Binary link rule
201 ##
202 $(OBJDIR)/%.exe: $(OBJDIR)/%.o $(OTHER_DEPS)
203 @$(MAKE_OBJDIR)
204 $(XFE_PURIFY) $(CC) -o $@ $< $(LDFLAGS)
205