root / JX / trunk / Makefile

Revision 3, 15.9 kB (checked in by daboo, 2 years ago)

Full commit of JX-2.5.0 code

Line 
1# Makefile to compile JX source distribution
2
3# If ACE_ROOT is defined, we toss the copy included in the distribution and
4# create a symbolic link to the existing directory.
5
6ifndef ACE_ROOT
7  DEFAULT_ACE_ROOT := ${shell cd ACE/ACE_wrappers; pwd}
8endif
9
10#
11# tell user what options are available
12#
13
14.PHONY : default
15default:
16        @echo
17
18  ifndef ACE_ROOT
19        @echo "If you already have a compatible version of ACE on your computer, then"
20        @echo "set ACE_ROOT to point to the top level ACE directory.  (This is part of"
21        @echo "the standard ACE configuration.)  If you don't have ACE installed, add"
22        @echo "the following to ~/.cshrc, if you use csh or tcsh:"
23        @echo
24        @echo "  setenv ACE_ROOT ${DEFAULT_ACE_ROOT}"
25        @echo
26        @echo "If you use bash, add the following to ~/.bashrc instead:"
27        @echo
28        @echo "  export ACE_ROOT=${DEFAULT_ACE_ROOT}"
29        @echo
30  endif
31
32        @echo "If you have compiled a compatible version of Mesa on your computer, then"
33        @echo "create a symbolic link ${shell pwd}/Mesa"
34        @echo "which points to the directory in which you built Mesa."
35        @echo
36
37 ifeq ($(shell whoami),root)
38
39  ifndef JX_INSTALL_ROOT
40        @echo "To install the binaries in a directory other than /usr/bin, set the"
41        @echo "environment variable JX_INSTALL_ROOT to the desired directory."
42        @echo "If you do this, JX_INSTALL_ROOT must be on your execution path."
43  endif
44        @echo
45  ifndef JX_LIB_ROOT
46        @echo "To install the libraries in a directory other than /usr/lib, set the"
47        @echo "environment variable JX_LIB_ROOT to the desired directory."
48  endif
49
50 else
51
52  ifndef JX_INSTALL_ROOT
53        @echo "To install the binaries in a directory other than ~/bin, (or ./bin, if"
54        @echo "~/bin doesn't exist), set the environment variable JX_INSTALL_ROOT to"
55        @echo "the desired directory.  (Use setenv if you use csh or export if you use bash.)"
56        @echo
57        @echo "This path (either ~/bin or JX_INSTALL_ROOT), must be on your execution path."
58        @echo "(Use the \"set path\" command.)"
59  endif
60
61 endif
62
63        @echo
64        @echo "Then run one of the following or check the README file:"
65        @echo
66        @echo "  ${MAKE} aix4_x-g++     for AIX 4.x with g++"
67#       @echo "  ${MAKE} corel1_x       for CorelLinux 1.x"
68        @echo "  ${MAKE} cygwin32       for Cygwin on Windows"
69#       @echo "  ${MAKE} debian1_x      for Debian 1.x GNU/Linux"
70#       @echo "  ${MAKE} debian2_x      for Debian 2.x GNU/Linux"
71        @echo "  ${MAKE} debian3_1      for Debian 3.1 GNU/Linux (Sarge)"
72        @echo "  ${MAKE} freebsd2_x     for FreeBSD 2.x"
73        @echo "  ${MAKE} freebsd3_x     for FreeBSD 3.x"
74        @echo "  ${MAKE} hpux10-g++     for HP-UX 10 with g++"
75        @echo "  ${MAKE} irix5_3-g++    for IRIX 5.3 with g++"
76        @echo "  ${MAKE} irix6_x-g++    for IRIX 6.x with g++"
77        @echo "  ${MAKE} linuxppc4      for LinuxPPC r4"
78        @echo "  ${MAKE} linuxppc5      for LinuxPPC r5"
79        @echo "  ${MAKE} mklinux        for MkLinux"
80        @echo "  ${MAKE} openbsd2_x     for OpenBSD 2.x"
81#       @echo "  ${MAKE} openlinux2_2   for OpenLinux 2.2"
82        @echo "  ${MAKE} osf1_4_x-g++   for Digital Unix (osf1) 4.x with g++"
83        @echo "  ${MAKE} OSX            for Macintosh OS X"
84        @echo "  ${MAKE} linux_intel    for Linux with g++ 3.x or above"
85        @echo "  ${MAKE} linux_intel-64 for RedHat 5.x & 6.x Linux on 64-bit systems"
86#       @echo "  ${MAKE} redhat5_x-kcc  for RedHat 5.x & 6.x Linux with KAI C++"
87#       @echo "  ${MAKE} slackware      for Slackware Linux"
88        @echo "  ${MAKE} sunos4-g++     for SunOS 4.x and g++"
89        @echo "  ${MAKE} sunos5_4-g++   for SunOS 5.4 (Solaris 2.4) with g++"
90        @echo "  ${MAKE} sunos5_5-g++   for SunOS 5.5 (Solaris 2.5) with g++"
91        @echo "  ${MAKE} sunos5_6-g++   for SunOS 5.6 (Solaris 2.6) with g++"
92        @echo "  ${MAKE} sunos5_7-g++   for SunOS 5.7 (Solaris 7)   with g++"
93        @echo "  ${MAKE} sunos5_8-g++   for SunOS 5.8 (Solaris 8)   with g++"
94        @echo "  ${MAKE} sunos5_9-g++   for SunOS 5.9 (Solaris 9)   with g++"
95#       @echo "  ${MAKE} suse5_x        for SuSE 5.x Linux"
96        @echo
97        @echo "If you are not sure which system you have, run \"uname -a\"."
98        @echo
99
100        @echo
101        @echo "To clean up afterwards, you can use:"
102        @echo
103        @echo "  ${MAKE} tidy           removes .o files"
104        @echo "  ${MAKE} clean          removes .o files and libraries"
105
106  ifeq ($(shell whoami),root)
107        @echo "  ${MAKE} uninstall      removes installed binaries and libraries"
108  else
109        @echo "  ${MAKE} uninstall      removes installed binaries"
110        @echo
111        @echo "The libraries are not installed in any system directories, so only use"
112        @echo "\"clean\" if you link everything statically."
113  endif
114
115  ifeq ($(findstring CVS, $(shell ls)), CVS)
116        @echo
117        @echo "For CVS users:"
118        @echo
119        @echo "  ${MAKE} -f lib/Makefile_CVS cvsprep"
120        @echo "    prepares directory structure after 'cvs get'"
121        @echo
122        @echo "  ${MAKE} -f lib/Makefile_CVS cvsupdate"
123        @echo "    gets latest source from CVS and prepares for build"
124  endif
125
126        @echo
127
128#
129# Useful variables
130#
131
132# ${JMAKE} insures that ACE_ROOT is passed to all other Makefiles
133# This can't be done earlier, because jx_constants redefines JX_INSTALL_ROOT,
134# thereby cancelling the message about it.
135
136JX_ROOT := .
137include ${JX_ROOT}/include/make/jx_constants
138
139JMAKE = ${MAKE} PATH=${PATH}:${JX_INSTALL_ROOT}
140
141INSTALL_CMD := cd lib; ${JMAKE} install
142
143#
144# Useful macros
145#
146
147TEST_ACE_CONFIG = \
148    if { test ! -f ACE/ACE_wrappers/ace/config.h; } then \
149        { \
150        ln -s
151
152CREATE_ACE_CONFIG = \
153        ACE/ACE_wrappers/ace/config.h; \
154        } \
155    fi
156
157TEST_ACE_MACROS = \
158    if { test ! -f ACE/ACE_wrappers/include/makeinclude/platform_macros.GNU; } then \
159        { \
160        ln -s
161
162CREATE_ACE_MACROS = \
163        ACE/ACE_wrappers/include/makeinclude/platform_macros.GNU; \
164        } \
165    fi
166
167#
168# RedHat 8.x, 9.x, Fedora (gcc 3.x)
169#
170
171.PHONY : linux_intel
172linux_intel: linux_common
173        @ln -s sys/Linux-Intel-gcc3  include/make/jx_config
174        @${INSTALL_CMD}
175
176#
177# 64-bit RedHat 5.x
178#
179
180.PHONY : linux_intel-64
181linux_intel-64: linux_common
182        @ln -s sys/Linux-Alpha-gcc3  include/make/jx_config
183        @${INSTALL_CMD}
184
185#
186# RedHat 5.x with KAI C++
187#
188
189.PHONY : redhat5_x-kcc
190redhat5_x-kcc: prep
191        @ln -s sys/Linux-Intel-RH5.x-kcc \
192           include/make/jx_config
193        @ln -s ../../include/missing_proto/jMissingProto_empty.h \
194           include/jcore/jMissingProto.h
195        @${TEST_ACE_CONFIG} config-linux-kcc.h ${CREATE_ACE_CONFIG}
196        @${TEST_ACE_MACROS} platform_linux_kcc.GNU ${CREATE_ACE_MACROS}
197
198        @${INSTALL_CMD}
199
200#
201# Debian
202#
203
204.PHONY : debian1_x
205debian1_x: redhat4.2
206
207.PHONY : debian2_x
208debian2_x: redhat5.x
209
210.PHONY : debian3_1
211debian3_1: linux_common
212        @ln -s sys/Linux-Intel-Debian3.1  include/make/jx_config
213        @${INSTALL_CMD}
214
215#
216# SuSE
217#
218
219.PHONY : suse5_x
220suse5_x: linux_common
221        @ln -s sys/Linux-Intel-SuSE5.x  include/make/jx_config
222        @${INSTALL_CMD}
223
224#
225# Slackware
226#
227
228.PHONY : slackware
229slackware: suse5_x
230
231#
232# OpenLinux
233#
234
235.PHONY : openlinux2_2
236openlinux2_2: linux_common
237        @ln -s sys/Linux-Intel-OpenLinux2.2  include/make/jx_config
238        @${INSTALL_CMD}
239
240#
241# Corel Linux 1.x
242#
243
244.PHONY : corel1_x
245corel1_x: linux_common
246        @ln -s sys/Linux-Intel-Corel1.0  include/make/jx_config
247        @${INSTALL_CMD}
248
249#
250# LinuxPPC r4
251#
252
253.PHONY : linuxppc4
254linuxppc4:
255        @ln -s sys/LinuxPPC_4  include/make/jx_config
256        @ln -s ../../include/missing_proto/jMissingProto_empty.h \
257           include/jcore/jMissingProto.h
258        @${TEST_ACE_CONFIG} config-linuxppc4.h ${CREATE_ACE_CONFIG}
259        @${TEST_ACE_MACROS} platform_linux.GNU ${CREATE_ACE_MACROS}
260        @${INSTALL_CMD}
261
262#
263# LinuxPPC r5
264#
265
266.PHONY : linuxppc5
267linuxppc5: linux_common
268        @ln -s sys/LinuxPPC_5  include/make/jx_config
269        @${INSTALL_CMD}
270
271#
272# MkLinux
273#
274
275.PHONY : mklinux
276mklinux: linux_common
277        @ln -s sys/MkLinux_g++  include/make/jx_config
278        @ln -s ../../include/missing_proto/jMissingProto_empty.h \
279           include/jcore/jMissingProto.h
280        @${TEST_ACE_CONFIG} config-mklinux.h ${CREATE_ACE_CONFIG}
281        @${TEST_ACE_MACROS} platform_linux.GNU ${CREATE_ACE_MACROS}
282        @${INSTALL_CMD}
283
284#
285# Linux shared code
286#
287
288.PHONY : linux_common
289linux_common: prep
290        @ln -s ../../include/missing_proto/jMissingProto_empty.h \
291           include/jcore/jMissingProto.h
292        @${TEST_ACE_CONFIG} config-linux.h ${CREATE_ACE_CONFIG}
293        @${TEST_ACE_MACROS} platform_linux.GNU ${CREATE_ACE_MACROS}
294
295#
296# Cygwin
297#
298
299.PHONY : cygwin32
300cygwin32: prep
301        @ln -s sys/Linux-Intel-cygwin32 \
302           include/make/jx_config
303        @ln -s ../../include/missing_proto/jMissingProto_CygWin.h \
304           include/jcore/jMissingProto.h
305        @${TEST_ACE_CONFIG} config-cygwin32.h ${CREATE_ACE_CONFIG}
306        @${TEST_ACE_MACROS} platform_cygwin32.GNU ${CREATE_ACE_MACROS}
307        @${INSTALL_CMD}
308
309#
310# FreeBSD
311#
312
313.PHONY : freebsd2_x
314freebsd2_x: prep
315        @ln -s sys/FreeBSD-2.x_g++ \
316           include/make/jx_config
317        @ln -s ../../include/missing_proto/jMissingProto_empty.h \
318           include/jcore/jMissingProto.h
319        @${TEST_ACE_CONFIG} config-freebsd.h ${CREATE_ACE_CONFIG}
320        @${TEST_ACE_MACROS} platform_freebsd.GNU ${CREATE_ACE_MACROS}
321        @${INSTALL_CMD}
322
323.PHONY : freebsd3_x
324freebsd3_x: prep
325        @ln -s sys/FreeBSD-3.x_g++ \
326           include/make/jx_config
327        @ln -s ../../include/missing_proto/jMissingProto_empty.h \
328           include/jcore/jMissingProto.h
329        @${TEST_ACE_CONFIG} config-freebsd-pthread.h ${CREATE_ACE_CONFIG}
330        @${TEST_ACE_MACROS} platform_freebsd_pthread.GNU ${CREATE_ACE_MACROS}
331        @${INSTALL_CMD}
332
333#
334# OpenBSD
335#
336
337.PHONY: openbsd2_x
338openbsd2_x: prep
339        @ln -s sys/OpenBSD_g++ \
340           include/make/jx_config
341        @ln -s ../../include/missing_proto/jMissingProto_empty.h \
342           include/jcore/jMissingProto.h
343        @${TEST_ACE_CONFIG} config-openbsd.h ${CREATE_ACE_CONFIG}
344        @${TEST_ACE_MACROS} platform_openbsd.GNU ${CREATE_ACE_MACROS}
345        @${INSTALL_CMD}
346
347#
348# OS X
349#
350
351.PHONY: OSX
352OSX: prep
353        @ln -s sys/OSX_g++ \
354           include/make/jx_config
355        @ln -s ../../include/missing_proto/jMissingProto_empty.h \
356           include/jcore/jMissingProto.h
357        @${TEST_ACE_CONFIG} config-macosx-panther.h ${CREATE_ACE_CONFIG}
358        @${TEST_ACE_MACROS} platform_macosx_panther.GNU ${CREATE_ACE_MACROS}
359        @${INSTALL_CMD}
360
361#
362# SunOS 4.x
363#
364
365.PHONY : sunos4-g++
366sunos4-g++: prep
367        @ln -s sys/SunOS-4_g++ \
368           include/make/jx_config
369        @ln -s ../../include/missing_proto/jMissingProto_SunOS4.h \
370           include/jcore/jMissingProto.h
371        @${TEST_ACE_CONFIG} config-sunos4-g++.h ${CREATE_ACE_CONFIG}
372        @${TEST_ACE_MACROS} platform_sunos4_g++.GNU ${CREATE_ACE_MACROS}
373        @${INSTALL_CMD}
374
375#
376# SunOS 5.4 (Solaris 2.4)
377#
378
379.PHONY : sunos5_4-g++
380sunos5_4-g++: prep
381        @ln -s sys/SunOS-5.4_g++ \
382           include/make/jx_config
383        @ln -s ../../include/missing_proto/jMissingProto_SunOS5.x.h \
384           include/jcore/jMissingProto.h
385        @${TEST_ACE_CONFIG} config-sunos5.4-g++.h ${CREATE_ACE_CONFIG}
386        @${TEST_ACE_MACROS} platform_sunos5_g++.GNU ${CREATE_ACE_MACROS}
387        @${INSTALL_CMD}
388
389#
390# SunOS 5.5 (Solaris 2.5)
391#
392
393.PHONY : sunos5_5-g++
394sunos5_5-g++: prep
395        @ln -s sys/SunOS-5.5_g++ \
396           include/make/jx_config
397        @ln -s ../../include/missing_proto/jMissingProto_SunOS5.x.h \
398           include/jcore/jMissingProto.h
399        @${TEST_ACE_CONFIG} config-sunos5.5.h ${CREATE_ACE_CONFIG}
400        @${TEST_ACE_MACROS} platform_sunos5_g++.GNU ${CREATE_ACE_MACROS}
401        @${INSTALL_CMD}
402
403#
404# SunOS 5.6 (Solaris 2.6)
405#
406
407.PHONY : sunos5_6-g++
408sunos5_6-g++: prep
409        @ln -s sys/SunOS-5.6_g++ \
410           include/make/jx_config
411        @ln -s ../../include/missing_proto/jMissingProto_SunOS5.x.h \
412           include/jcore/jMissingProto.h
413        @${TEST_ACE_CONFIG} config-sunos5.6.h ${CREATE_ACE_CONFIG}
414        @${TEST_ACE_MACROS} platform_sunos5_g++.GNU ${CREATE_ACE_MACROS}
415        @${INSTALL_CMD}
416
417#
418# SunOS 5.7 (Solaris 7)
419#
420
421.PHONY : sunos5_7-g++
422sunos5_7-g++: prep
423        @ln -s sys/SunOS-5.7_g++ \
424           include/make/jx_config
425        @ln -s ../../include/missing_proto/jMissingProto_SunOS5.7.h \
426           include/jcore/jMissingProto.h
427        @${TEST_ACE_CONFIG} config-sunos5.7.h ${CREATE_ACE_CONFIG}
428        @${TEST_ACE_MACROS} platform_sunos5_g++.GNU ${CREATE_ACE_MACROS}
429        @${INSTALL_CMD}
430
431#
432# SunOS 5.8 (Solaris 8)
433#
434
435PHONY : sunos5_8-g++
436sunos5_8-g++: prep
437        @ln -s sys/SunOS-5.7_g++ \
438           include/make/jx_config
439        @ln -s ../../include/missing_proto/jMissingProto_SunOS5.x.h \
440           include/jcore/jMissingProto.h
441        @${TEST_ACE_CONFIG} config-sunos5.8.h ${CREATE_ACE_CONFIG}
442        @${TEST_ACE_MACROS} platform_sunos5_g++.GNU ${CREATE_ACE_MACROS}
443        @${INSTALL_CMD}
444
445#
446# SunOS 5.9 (Solaris 9)
447#
448
449PHONY : sunos5_9-g++
450sunos5_9-g++: prep
451        @ln -s sys/SunOS-5.9_g++ \
452           include/make/jx_config
453        @ln -s ../../include/missing_proto/jMissingProto_SunOS5.x.h \
454           include/jcore/jMissingProto.h
455        @${TEST_ACE_CONFIG} config-sunos5.9.h ${CREATE_ACE_CONFIG}
456        @${TEST_ACE_MACROS} platform_sunos5_g++.GNU ${CREATE_ACE_MACROS}
457        @${INSTALL_CMD}
458
459#
460# HP-UX 10
461#
462
463.PHONY : hpux10-g++
464hpux10-g++: prep
465        @ln -s sys/HP-UX10_g++ \
466           include/make/jx_config
467        @ln -s ../../include/missing_proto/jMissingProto_HPUX10.h \
468           include/jcore/jMissingProto.h
469        @${TEST_ACE_CONFIG} config-hpux-10.x-g++.h ${CREATE_ACE_CONFIG}
470        @${TEST_ACE_MACROS} platform_hpux_gcc.GNU ${CREATE_ACE_MACROS}
471        @${INSTALL_CMD}
472
473#
474# IRIX 5.3
475#
476
477.PHONY : irix5_3-g++
478irix5_3-g++: prep
479        @ln -s sys/IRIX-5.x_g++ \
480           include/make/jx_config
481        @ln -s ../../include/missing_proto/jMissingProto_IRIX5.x.h \
482           include/jcore/jMissingProto.h
483        @${TEST_ACE_CONFIG} config-irix5.3-g++.h ${CREATE_ACE_CONFIG}
484        @${TEST_ACE_MACROS} platform_irix5.3_g++.GNU ${CREATE_ACE_MACROS}
485        @${INSTALL_CMD}
486
487#
488# IRIX 6.x
489#
490
491.PHONY : irix6_x-g++
492irix6_x-g++: prep
493        @ln -s sys/IRIX-6.x_g++ \
494           include/make/jx_config
495        @ln -s ../../include/missing_proto/jMissingProto_IRIX6.x.h \
496           include/jcore/jMissingProto.h
497        @${TEST_ACE_CONFIG} config-irix6.x-g++.h ${CREATE_ACE_CONFIG}
498        @${TEST_ACE_MACROS} platform_irix6.x_g++.GNU ${CREATE_ACE_MACROS}
499        @${INSTALL_CMD}
500
501#
502# Digital UNIX (OSF1) 4.x
503#
504
505.PHONY : osf1_4_x-g++
506osf1_4_x-g++: prep
507        @ln -s sys/OSF1-4.x_g++ \
508           include/make/jx_config
509        @ln -s ../../include/missing_proto/jMissingProto_empty.h \
510           include/jcore/jMissingProto.h
511        @${TEST_ACE_CONFIG} config-osf1-4.0.h ${CREATE_ACE_CONFIG}
512        @${TEST_ACE_MACROS} platform_osf1_4.0_g++.GNU ${CREATE_ACE_MACROS}
513        @${INSTALL_CMD}
514
515#
516# AIX 4.x
517#
518
519.PHONY : aix4_x-g++
520aix4_x-g++: prep
521        @ln -s sys/AIX-4.x_g++ \
522           include/make/jx_config
523        @ln -s ../../include/missing_proto/jMissingProto_AIX4.x.h \
524           include/jcore/jMissingProto.h
525        @${TEST_ACE_CONFIG} config-aix-4.x.h ${CREATE_ACE_CONFIG}
526        @${TEST_ACE_MACROS} platform_aix4_g++.GNU ${CREATE_ACE_MACROS}
527        @${INSTALL_CMD}
528
529#
530# shared code
531#
532
533.PHONY : prep
534prep: check_install_dir fix_ace clean_links
535
536# Solaris test doesn't support ! operator
537
538.PHONY : check_install_dir
539check_install_dir:
540  ifdef JX_INSTALL_ROOT
541        @if { test -d ${JX_INSTALL_ROOT} -a -w ${JX_INSTALL_ROOT}; } then \
542         { \
543         true; \
544         } \
545     else \
546         { \
547         echo; \
548         echo "Please set JX_INSTALL_ROOT to a valid directory and make sure that"; \
549         echo "it is on your execution path."; \
550         echo; \
551         false; \
552         } \
553     fi
554  endif
555
556#       @if { test -d ${ACE_ROOT} -a ! ACE/ACE_wrappers -ef ${ACE_ROOT}; } then
557
558CHECK_ACE := lib/util/j_has_ace
559
560CC := ${shell if { which gcc > /dev/null; } \
561              then { echo gcc; } \
562              else { echo ${CC}; } fi }
563
564.PHONY : fix_ace
565fix_ace:
566  ifdef ACE_ROOT
567        @if { test ! -d ACE/ACE_wrappers || \
568          { ${CC} ${CHECK_ACE}.c -o ${CHECK_ACE}; \
569            ${CHECK_ACE} ${ACE_ROOT} ACE/ACE_wrappers; } ; } then \
570         { \
571         ${RM} -r ACE/ACE_wrappers; \
572         ln -s ${ACE_ROOT} ACE/ACE_wrappers; \
573         } \
574     fi; \
575     if { test ! '(' -f ${ACE_ROOT}/ace/Makefile -o -f ${ACE_ROOT}/ace/GNUmakefile ')'; } then \
576         { \
577         ${RM} lib/libACE-${ACE_LIB_VERSION}.a; \
578         ln -s /usr/lib/libACE.a lib/libACE-${ACE_LIB_VERSION}.a; \
579         ${RM} lib/libACE-${ACE_LIB_VERSION}.so; \
580         ln -s /usr/lib/libACE.so lib/libACE-${ACE_LIB_VERSION}.so; \
581         ${RM} lib/libACE.so.${ACE_VERSION}; \
582         } \
583     fi
584  endif
585
586.PHONY : clean_links
587clean_links:
588        @${RM} include/make/jx_config
589        @${RM} include/jcore/jMissingProto.h
590        @if { test ! -L ACE/ACE_wrappers; } then \
591         { \
592         ${RM} ACE/ACE_wrappers/ace/config.h; \
593         ${RM} ACE/ACE_wrappers/include/makeinclude/platform_macros.GNU; \
594         } \
595     fi
596
597#
598# clean up
599#
600
601.PHONY : tidy
602tidy:
603        @cd lib; ${JMAKE} tidy
604
605.PHONY : clean
606clean:
607        @cd lib; ${JMAKE} clean
608
609.PHONY : uninstall
610uninstall:
611        @cd lib; ${JMAKE} uninstall
Note: See TracBrowser for help on using the browser.