-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakemake
executable file
·1109 lines (976 loc) · 28.2 KB
/
makemake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/sh
#
# Procedure to create PGPLOT makefile
#
#-----------------------------------------------------------------------
if test $# -lt 1; then
echo "Usage: makemake pgplot_dist operating_system configuration key1=val1 key2=val2 ..."
echo " pgplot_dist = The top level directory of the PGPLOT distribution."
echo " (ie. The directory in which makemake was found!)."
echo " operating_system = Operating system name (omit this to get a list)."
echo " configuration = Optional if there is only one for the specified OS."
echo " (Otherwise you will be presented with a list)"
echo " keyN=valN = Optionally up to 4 keyword substutions in the config file"
echo " Common examples: gcc=gcc32"
echo " /X11R6/lib=/X11R6/lib64"
exit 1
fi
SRC=$1
# Check for the required PGPLOT sub-directories.
for dir in drivers examples fonts src sys ; do
if test ! -d $SRC/$dir; then
echo "Failed to find required PGPLOT directory $SRC/$dir"
echo "The first argument must name the PGPLOT root directory."
exit 1
fi
done
# The second argument is the name of the target operating system.
if test $# -ge 2 -a -d $SRC/sys_$2; then
OS=$2
SYSDIR=$SRC/sys_$OS
else
echo 'The second argument must be one of the following operating systems:'
cd $SRC
echo " `echo sys_* | sed 's/sys_//g'`"
exit 1
fi
if test -r $SYSDIR/aaaread.me; then
echo 'For additional information, read file' $SYSDIR/aaaread.me
fi
# The third argument is optional if there is only a single configuration
# but must be specified otherwise.
if test $# -ge 3 -a -f "$SYSDIR/$3.conf"; then
CONFIG="$SYSDIR/$3.conf"
elif test $# -lt 3 -a -f ./local.conf; then
CONFIG="./local.conf"
elif test $# -lt 3 -a -f "`ls $SYSDIR/*.conf`"; then
CONFIG="`ls $SYSDIR/*.conf`"
else
cd $SRC/sys_$OS
config_files=`echo *.conf`
if test "$config_files" = '*.conf'; then
echo "No configuration files found for $OS"
else
echo "The third argument for $OS must be one of the following configuration types:"
for file in $config_files; do
echo `echo $file | sed 's/\.conf//'` - `head -1 $file | sed 's/#//'`
done
fi
exit 1
fi
# By default the PGPLOT library is initially placed in the current
# The demos should be explicitly linked against this library.
PGPLOT_LIB="-L\`pwd\` -lpgplot"
CPGPLOT_LIB="-L\`pwd\` -lcpgplot -lpgplot"
# List the default make targets.
DEFAULT_TARGETS="lib grfont.dat prog pgplot.doc"
# Parse remaining parameters, need to be key=val substitutions
# use it to change the actual name if the flavor of the compiler
# is known
# e.g. linux g77_gcc gcc=gcc33
# linux g77_gcc /X11R6/lib=/X11R6/lib64
# Get the configuration variables.
if test $# -ge 4; then
shift; shift; shift;
echo "Creating local_sed.conf for: $*"
if test $# -eq 1; then
sed s=$1= $CONFIG > local_sed.conf
elif test $# -eq 2; then
sed s=$1= $CONFIG | sed s=$2= > local_sed.conf
elif test $# -eq 3; then
sed s=$1= $CONFIG | sed s=$2= | sed s=$3= > local_sed.conf
elif test $# -eq 4; then
sed s=$1= $CONFIG | sed s=$2= | sed s=$3= | sed s=$4= > local_sed.conf
else
echo "Cannot handle more than 4 substitutions... you'll need to hack the makemake script"
echo "and change the help section here"
exit 1
fi
CONFIG=./local_sed.conf
fi
echo "Reading configuration file: $CONFIG"
. $CONFIG
# List the files that will need to be installed by the person who
# is running this script.
INSTALL_LIST="libpgplot.a $SHARED_LIB grfont.dat rgb.txt"
#-----------------------------------------------------------------------
# PGPLOT source directories.
#-----------------------------------------------------------------------
SRCDIR=$SRC/src
OBSDIR=$SRC/obssrc
DEMDIR=$SRC/examples
FNTDIR=$SRC/fonts
DRVDIR=$SRC/drivers
PGDDIR=$SRC/pgdispd
GENDIR=$SRC/sys
#-----------------------------------------------------------------------
# Device drivers
#-----------------------------------------------------------------------
ARDRIV="ardriv.o"
BCDRIV="bcdriv.o"
CADRIV="cadriv.o"
CCDRIV="ccdriv.o"
CGDRIV="cgdriv.o"
CWDRIV="cwdriv.o"
EPDRIV="epdriv.o"
EXDRIV="exdriv.o"
GCDRIV="gcdriv.o"
GIDRIV="gidriv.o"
GLDRIV="gldriv.o"
GODRIV="godriv.o"
GRDRIV="grdriv.o"
GVDRIV="gvdriv.o"
HGDRIV="hgdriv.o"
HIDRIV="hidriv.o"
HJDRIV="hjdriv.o"
HPDRIV="hpdriv.o"
IKDRIV="ikdriv.o"
IMDRIV="imdriv.o"
IRDRIV="irdriv.o"
LADRIV="ladriv.o"
LHDRIV="lhdriv.o"
LIDRIV="lidriv.o"
LJDRIV="ljdriv.o"
LNDRIV="lndriv.o"
LSDRIV="lsdriv.o"
LVDRIV="lvdriv.o"
LXDRIV="lxdriv.o"
MFDRIV="mfdriv.o"
NEDRIV="nedriv.o nexsup.o"
NUDRIV="nudriv.o"
PGDRIV="pgdriv.o"
PKDRIV="pkdriv.o"
PNDRIV="pndriv.o"
PPDRIV="ppdriv.o"
PSDRIV="psdriv.o"
PXDRIV="pxdriv.o"
PZDRIV="pzdriv.o"
QMDRIV="qmdriv.o"
SVDRIV="svdriv.o svblock.o"
TFDRIV="tfdriv.o"
TODRIV="todriv.o"
TTDRIV="ttdriv.o"
TXDRIV="txdriv.o"
VADRIV="vadriv.o"
VBDRIV="vbdriv.o"
VEDRIV="vedriv.o"
VIDRIV="vidriv.o"
VTDRIV="vtdriv.o"
WDDRIV="wddriv.o"
WSDRIV="wsdriv.o"
X2DRIV="x2driv.o figdisp_comm.o"
XEDRIV="xedriv.o"
XWDRIV="xwdriv.o"
ZEDRIV="zedriv.o"
XMDRIV="xmdriv.o pgxwin.o"
XADRIV="xadriv.o pgxwin.o"
TKDRIV="tkdriv.o pgxwin.o"
RVDRIV="rvdriv.o pgxwin.o"
# We need a drivers.list file in the current directory, from which to
# determine the drivers to be compiled.
if test -f drivers.list; then
echo 'Selecting uncommented drivers from ./drivers.list'
else
cp $SRC/drivers.list .
echo 'Please specify required drivers by un-commenting them in ./drivers.list.'
echo "Then re-run $0"
exit 1
fi
# Get a list of driver names.
DRIV_LIST=`awk '/^[^!]/{printf("$%s\n", $1)}' drivers.list | sort | uniq`
echo "Found drivers `echo $DRIV_LIST | sed 's/\\\$//g'`"
# Convert the list of drivers to the list of dependent object files.
# This involves expanding the $xxDRIV driver-dependency variables,
# and removing duplicate object files.
DRIV_LIST=`eval echo $DRIV_LIST | awk '{for(i=1;i<=NF;i++) print $i}' | sort | uniq | awk '{printf("%s ", $0)} END{printf("\n")}'`
# Add server targets to the default target list if their respective
# drivers have been selected.
if (echo $DRIV_LIST | grep -s x2driv 2>&1 1>/dev/null); then
DEFAULT_TARGETS="$DEFAULT_TARGETS pgdisp"
INSTALL_LIST="$INSTALL_LIST pgdisp"
fi
if (echo $DRIV_LIST | grep -s xwdriv 2>&1 1>/dev/null); then
DEFAULT_TARGETS="$DEFAULT_TARGETS pgxwin_server"
INSTALL_LIST="$INSTALL_LIST pgxwin_server"
fi
if (echo $DRIV_LIST | grep -s xmdriv 2>&1 1>/dev/null); then
DEFAULT_TARGETS="$DEFAULT_TARGETS libXmPgplot.a pgmdemo"
INSTALL_LIST="$INSTALL_LIST libXmPgplot.a XmPgplot.h"
fi
if (echo $DRIV_LIST | grep -s xadriv 2>&1 1>/dev/null); then
DEFAULT_TARGETS="$DEFAULT_TARGETS libXaPgplot.a pgawdemo"
INSTALL_LIST="$INSTALL_LIST libXaPgplot.a XaPgplot.h"
fi
if (echo $DRIV_LIST | grep -s tkdriv 2>&1 1>/dev/null); then
DEFAULT_TARGETS="$DEFAULT_TARGETS libtkpgplot.a pgtkdemo pgtkdemo.tcl"
INSTALL_LIST="$INSTALL_LIST libtkpgplot.a tkpgplot.h"
fi
if (echo $DRIV_LIST | grep -s rvdriv 2>&1 1>/dev/null); then
DEFAULT_TARGETS="$DEFAULT_TARGETS librvpgplot.a rvpgplot.h"
INSTALL_LIST="$INSTALL_LIST librvpgplot.a rvpgplot.h"
fi
# PNDRIV requires extra libraries and include files
if (echo $DRIV_LIST | grep -s pndriv 2>&1 1>/dev/null); then
PGPLOT_LIB="$PGPLOT_LIB -lpng -lz"
CPGPLOT_LIB="$CPGPLOT_LIB -lpng -lz"
fi
# Create a new grexec.f that calls the above drivers.
awk -f $SRC/grexec.awk drivers.list > grexec.f
# Some FORTRAN compilers expect their include files to appear in the
# directory containing the source code. Others expect them to be in the
# directory in which you actually do the compilation. To allow both cases
# copy the include files into the current directory.
cp $SRCDIR/*.inc .
#-----------------------------------------------------------------------
# Routine lists:
# PG_ROUTINES: basic PGPLOT routines (Fortran-77).
# PG_NON_STANDARD: non-Fortran-77 aliases for basic routines.
# GR_ROUTINES: support routines, not called directly by applications
# (Fortran-77).
# SYSTEM_ROUTINES: potentially non-portable routines, usually
# operating-system dependent.
# OBSOLETE_ROUTINES: obsolete routines used by some programs.
# DEMOS: demonstration programs
#-----------------------------------------------------------------------
PG_ROUTINES="\
pgarro.o\
pgask.o \
pgaxis.o\
pgaxlg.o\
pgband.o\
pgbbuf.o\
pgbeg.o \
pgbin.o \
pgbox.o \
pgbox1.o\
pgcirc.o\
pgcl.o \
pgclos.o\
pgcn01.o\
pgcnsc.o\
pgconb.o\
pgconf.o\
pgconl.o\
pgcons.o\
pgcont.o\
pgconx.o\
pgcp.o \
pgctab.o\
pgcurs.o\
pgdraw.o\
pgebuf.o\
pgend.o \
pgenv.o \
pgeras.o\
pgerr1.o\
pgerrb.o\
pgerrx.o\
pgerry.o\
pgetxt.o\
pgfunt.o\
pgfunx.o\
pgfuny.o\
pggray.o\
pghi2d.o\
pghis1.o\
pghist.o\
pghtch.o\
pgiden.o\
pgimag.o\
pginit.o\
pglab.o \
pglcur.o\
pgldev.o\
pglen.o \
pgline.o\
pgmove.o\
pgmtxt.o\
pgncur.o\
pgnoto.o\
pgnpl.o \
pgnumb.o\
pgolin.o\
pgopen.o\
pgpage.o\
pgpanl.o\
pgpap.o \
pgpixl.o\
pgpnts.o\
pgpoly.o\
pgpt.o \
pgpt1.o \
pgptxt.o\
pgqah.o \
pgqcf.o \
pgqch.o \
pgqci.o \
pgqcir.o\
pgqclp.o\
pgqcol.o\
pgqcr.o \
pgqcs.o \
pgqdt.o \
pgqfs.o \
pgqhs.o \
pgqid.o \
pgqinf.o\
pgqitf.o\
pgqls.o \
pgqlw.o \
pgqndt.o\
pgqpos.o\
pgqtbg.o\
pgqtxt.o\
pgqvp.o \
pgqvsz.o\
pgqwin.o\
pgrect.o\
pgrnd.o \
pgrnge.o\
pgsah.o \
pgsave.o\
pgscf.o \
pgsch.o \
pgsci.o \
pgscir.o\
pgsclp.o\
pgscr.o \
pgscrl.o\
pgscrn.o\
pgsfs.o \
pgshls.o\
pgshs.o \
pgsitf.o\
pgslct.o\
pgsls.o \
pgslw.o \
pgstbg.o\
pgsubp.o\
pgsvp.o \
pgswin.o\
pgtbox.o\
pgtext.o\
pgtick.o\
pgtikl.o\
pgupdt.o\
pgvect.o\
pgvsiz.o\
pgvstd.o\
pgvw.o \
pgwedg.o\
pgwnad.o\
"
PG_NON_STANDARD="\
pgadvance.o\
pgbegin.o \
pgcurse.o \
pglabel.o \
pgmtext.o \
pgncurse.o \
pgpaper.o \
pgpoint.o \
pgptext.o \
pgvport.o \
pgvsize.o \
pgvstand.o \
pgwindow.o \
"
GR_ROUTINES="\
grarea.o\
grbpic.o\
grchsz.o\
grclip.o\
grclos.o\
grclpl.o\
grctoi.o\
grcurs.o\
grdot0.o\
grdot1.o\
grdtyp.o\
gresc.o \
grepic.o\
gretxt.o\
grfa.o \
grfao.o \
grgfil.o\
grgray.o\
grimg0.o\
grimg1.o\
grimg2.o\
grimg3.o\
grinit.o\
gritoc.o\
grlen.o \
grlin0.o\
grlin1.o\
grlin2.o\
grlin3.o\
grlina.o\
grmcur.o\
grmker.o\
grmova.o\
grmsg.o\
gropen.o\
grpage.o\
grpars.o\
grpixl.o\
grpocl.o\
grprom.o\
grpxpo.o\
grpxps.o\
grpxpx.o\
grpxre.o\
grqcap.o\
grqci.o \
grqcol.o\
grqcr.o \
grqdev.o\
grqdt.o \
grqfnt.o\
grqls.o \
grqlw.o \
grqpos.o\
grqtxt.o\
grqtyp.o\
grquit.o\
grrec0.o\
grrect.o\
grsci.o \
grscr.o \
grscrl.o\
grsetc.o\
grsets.o\
grsfnt.o\
grsize.o\
grskpb.o\
grslct.o\
grsls.o \
grslw.o \
grsyds.o\
grsymk.o\
grsyxd.o\
grterm.o\
grtext.o\
grtoup.o\
grtrim.o\
grtrn0.o\
grtxy0.o\
grvct0.o\
grwarn.o\
grxhls.o\
grxrgb.o\
"
SYSTEM_ROUTINES="\
grdate.o\
grfileio.o\
grflun.o\
grgcom.o\
grgenv.o\
grgetc.o\
grglun.o\
grgmem.o\
grgmsg.o\
grlgtr.o\
groptx.o\
grsy00.o\
grtermio.o\
grtrml.o\
grtter.o\
gruser.o\
"
OBSOLETE_ROUTINES="\
grchar.o\
grchr0.o\
grdat2.o\
grgtc0.o\
grinqfont.o\
grinqli.o\
grinqpen.o\
grlinr.o\
grmark.o\
grmovr.o\
grsetfont.o\
grsetli.o\
grsetpen.o\
grtran.o\
grvect.o\
pgsetc.o\
pgsize.o\
"
OPTIONAL_ROUTINES="\
iand.o\
"
PGDISP_ROUTINES="\
cleanup.o\
pgdisp.o\
figcurs.o\
getdata.o\
getvisuals.o\
handlexevent.o\
proccom.o\
resdb.o\
exposelgwin.o\
getcolors.o\
initlgluts.o\
initlgwin.o\
initlock.o\
initwmattr.o\
mainloop.o\
resizelgwin.o\
returnbuf.o\
waitevent.o\
updatelgtitle.o\
"
DEMOS="\
pgdemo1\
pgdemo2\
pgdemo3\
pgdemo4\
pgdemo5\
pgdemo6\
pgdemo7\
pgdemo8\
pgdemo9\
pgdemo10\
pgdemo11\
pgdemo12\
pgdemo13\
pgdemo14\
pgdemo15\
pgdemo16\
pgdemo17\
"
#
# If any optional system routines are found, add them to the
# list of required system routines.
#
for file in `(echo $OPTIONAL_ROUTINES | sed 's/\.o//g')`; do
if test -f $SYSDIR/${file}.c -o -f $SYSDIR/${file}.f; then
SYSTEM_ROUTINES="$SYSTEM_ROUTINES ${file}.o"
fi
done
#
# System specific C wrapper routines for the standard drivers are
# named ..wrap.c in the appropriate system directory, where .. is the
# two letter ..driv.c prefix of a given driver.
#
for file in `(echo $DRIV_LIST | sed 's/\.o//g')`; do
if test -f $DRVDIR/${file}.c; then
wrapper="`(echo $file | sed 's/driv$/wrap/')`"
if test -f $SYSDIR/${wrapper}.c -o -f $SYSDIR/${wrapper}.m ; then
SYSTEM_ROUTINES="$SYSTEM_ROUTINES ${wrapper}.o"
fi
fi
done
# Don't override any existing (possibly modified version of rgb.txt).
if test ! -f rgb.txt; then
echo 'Copying color database.'
cp $SRC/rgb.txt .
fi
echo "Creating make file: makefile"
cat > makefile << EOD
# Makefile for PGPLOT.
# $0 $*
# This file is automatically generated. Do not edit.
#
# This generates the PGPLOT binary files (libraries and demos) in the
# current default directory (which need not be the source directory).
#-----------------------------------------------------------------------
SHELL=/bin/sh
# PGPLOT subdirectories
SRC=$SRC
SRCDIR=$SRCDIR
OBSDIR=$OBSDIR
DEMDIR=$DEMDIR
FNTDIR=$FNTDIR
DRVDIR=$DRVDIR
SYSDIR=$SYSDIR
PGDDIR=$PGDDIR
GENDIR=$GENDIR
XMDIR=$DRVDIR/xmotif
XADIR=$DRVDIR/xathena
TKDIR=$DRVDIR/xtk
#
# Fortran compiler and compilation flags
#
FCOMPL=$FCOMPL
FFLAGC=$FFLAGC
FFLAGD=$FFLAGD
#
# C compiler and compilation flags
#
XINCL=$XINCL
MOTIF_INCL=$MOTIF_INCL
ATHENA_INCL=$ATHENA_INCL
TK_INCL=$TK_INCL
RV_INCL=$RV_INCL
CCOMPL=$CCOMPL
CFLAGC=$CFLAGC -I.
CFLAGD=$CFLAGD
MCOMPL=$MCOMPL
MFLAGC=$MFLAGC
#
# Pgbind flags.
#
PGBIND_FLAGS=$PGBIND_FLAGS
#
# Loader library-flags
#
LIBS=$LIBS
MOTIF_LIBS=$MOTIF_LIBS
ATHENA_LIBS=$ATHENA_LIBS
TK_LIBS=$TK_LIBS
#
# Loader command for PGPLOT library
#
PGPLOT_LIB=$PGPLOT_LIB
CPGPLOT_LIB=$CPGPLOT_LIB
#
# Shared library creation.
#
SHARED_LIB=$SHARED_LIB
SHARED_LD=$SHARED_LD
#
# The libraries that the shared PGPLOT library depends upon.
# This is for systems that allow one to specify what libraries
# undefined symbols of a shared library reside in. Such systems
# (eg. Solaris 2.x) use this information at run time so that users of
# the library don't have to list a slew of other implementation-specific
# libraries when they link their executables.
#
SHARED_LIB_LIBS=$SHARED_LIB_LIBS
#
# Ranlib command if required
#
RANLIB=$RANLIB
#
# Routine lists.
#
PG_ROUTINES=$PG_ROUTINES
PG_NON_STANDARD=$PG_NON_STANDARD
GR_ROUTINES=$GR_ROUTINES
SYSTEM_ROUTINES=$SYSTEM_ROUTINES
OBSOLETE_ROUTINES=$OBSOLETE_ROUTINES
DRIVERS=$DRIV_LIST
PGDISP_ROUTINES=$PGDISP_ROUTINES
DEMOS=$DEMOS
#
#-----------------------------------------------------------------------
# Target "all" makes everything (except the library of obsolete routines)
#-----------------------------------------------------------------------
all: $DEFAULT_TARGETS
@echo ' ';echo '*** Finished compilation of PGPLOT ***';echo ' '
@echo 'Note that if you plan to install PGPLOT in a different'
@echo 'directory than the current one, the following files will be'
@echo 'needed.'
@echo ' '
EOD
for file in $INSTALL_LIST; do
echo " @echo ' $file'"
done >> makefile
cat >> makefile << EOD
@echo ' '
@echo 'Also note that subsequent usage of PGPLOT programs requires that'
@echo 'the full path of the chosen installation directory be named in'
@echo 'an environment variable named PGPLOT_DIR.'
@echo ' '
#-----------------------------------------------------------------------
# Rules for compiling the .o files
#-----------------------------------------------------------------------
EOD
echo 'Determining object file dependencies.'
# List source code file dependencies explicitly.
for file in `(echo $PG_ROUTINES | sed 's/\.o//g')`; do
echo "${file}.o: \$(SRCDIR)/${file}.f"
echo " \$(FCOMPL) -c \$(FFLAGC) \$(SRCDIR)/${file}.f"
done >> makefile
for file in `(echo $PG_NON_STANDARD | sed 's/\.o//g')`; do
echo "${file}.o: \$(SRCDIR)/${file}.f"
echo " \$(FCOMPL) -c \$(FFLAGC) \$(SRCDIR)/${file}.f"
done >> makefile
for file in `(echo $GR_ROUTINES | sed 's/\.o//g')`; do
echo "${file}.o: \$(SRCDIR)/${file}.f"
echo " \$(FCOMPL) -c \$(FFLAGC) \$(SRCDIR)/${file}.f"
done >> makefile
for file in `(echo $SYSTEM_ROUTINES | sed 's/\.o//g')`; do
if test -f $SYSDIR/${file}.f; then
echo "${file}.o: \$(SYSDIR)/${file}.f"
echo " \$(FCOMPL) -c \$(FFLAGC) \$(SYSDIR)/${file}.f"
elif test -f $SYSDIR/${file}.c; then
echo "${file}.o: \$(SYSDIR)/${file}.c"
echo " \$(CCOMPL) -c \$(CFLAGC) \$(SYSDIR)/${file}.c"
elif test -f $SYSDIR/${file}.m; then
echo "${file}.o: \$(SYSDIR)/${file}.m"
echo " \$(MCOMPL) -c \$(MFLAGC) \$(SYSDIR)/${file}.m"
elif test -f $GENDIR/${file}.f; then
echo "${file}.o: \$(GENDIR)/${file}.f"
echo " \$(FCOMPL) -c \$(FFLAGC) \$(GENDIR)/${file}.f"
elif test -f $GENDIR/${file}.c; then
echo "${file}.o: \$(GENDIR)/${file}.c"
echo " \$(CCOMPL) -c \$(CFLAGC) \$(GENDIR)/${file}.c"
else
echo "Warning: Unable to find source code for ${file}.o in either $SYSDIR or $GENDIR" 1>&2
fi
done >> makefile
for file in `(echo $OBSOLETE_ROUTINES | sed 's/\.o//g')`; do
echo "${file}.o: \$(OBSDIR)/${file}.f"
echo " \$(FCOMPL) -c \$(FFLAGC) \$(OBSDIR)/${file}.f"
done >> makefile
# Emit pgdisp rules.
for file in `(echo $PGDISP_ROUTINES | sed 's/\.o//g')`; do
echo "${file}.o: \$(PGDDIR)/${file}.c"
echo " \$(CCOMPL) -c \$(CFLAGC) \$(XINCL) -DPGDISP \$(PGDDIR)/${file}.c"
done >> makefile
# Emit driver dependencies.
for file in `(echo $DRIV_LIST | sed 's/\.o//g')`; do
if test -f $SYSDIR/${file}.f; then
echo "${file}.o: \$(SYSDIR)/${file}.f"
echo " \$(FCOMPL) -c \$(FFLAGC) \$(SYSDIR)/${file}.f"
elif test -f $SYSDIR/${file}.c; then
echo "${file}.o: \$(SYSDIR)/${file}.c"
echo " \$(CCOMPL) -c \$(CFLAGC) \$(XINCL) \$(SYSDIR)/${file}.c"
elif test -f $SYSDIR/${file}.m; then
echo "${file}.o: \$(SYSDIR)/${file}.m"
echo " \$(MCOMPL) -c \$(MFLAGC) \$(XINCL) \$(SYSDIR)/${file}.m"
elif test -f $DRVDIR/${file}.f; then
echo "${file}.o: \$(DRVDIR)/${file}.f"
echo " \$(FCOMPL) -c \$(FFLAGC) \$(DRVDIR)/${file}.f"
elif test -f $DRVDIR/${file}.c; then
echo "${file}.o: \$(DRVDIR)/${file}.c"
echo " \$(CCOMPL) -c \$(CFLAGC) \$(XINCL) \$(DRVDIR)/${file}.c"
elif test -f $DRVDIR/${file}.m; then
echo "${file}.o: \$(DRVDIR)/${file}.m"
echo " \$(MCOMPL) -c \$(MFLAGC) \$(XINCL) \$(DRVDIR)/${file}.m"
else
echo "Unable to find source code for ${file}.o in $SYSDIR or $DRVDIR/" 1>&2
exit 1
fi
done >> makefile
cat >> makefile << \EOD
#-----------------------------------------------------------------------
# The device-driver dispatch routine is generated automatically by
# reading the "drivers.list" file.
#-----------------------------------------------------------------------
DISPATCH_ROUTINE=grexec.o
grexec.o: grexec.f
$(FCOMPL) -c $(FFLAGC) grexec.f
#-----------------------------------------------------------------------
# Target "lib" is used to built the PGPLOT subroutine library.
# libpgplot.a is the primary PGPLOT object library.
# "shared" is an optional target for operating systems that allow shared
# libraries.
#-----------------------------------------------------------------------
lib : libpgplot.a $(SHARED_LIB)
libpgplot.a : $(PG_ROUTINES) $(PG_NON_STANDARD) $(GR_ROUTINES) \
$(DISPATCH_ROUTINE) $(DRIVERS) $(SYSTEM_ROUTINES)
ar ru libpgplot.a \
`ls $(PG_ROUTINES) \
$(PG_NON_STANDARD) $(GR_ROUTINES) $(DISPATCH_ROUTINE) \
$(DRIVERS) $(SYSTEM_ROUTINES) | sort | uniq`
$(RANLIB) libpgplot.a
EOD
# Emit the shared library dependency if requested.
if test -n "$SHARED_LIB" -a -n "$SHARED_LD"; then
cat >> makefile << \EOD
$(SHARED_LIB): $(PG_ROUTINES) $(PG_NON_STANDARD) \
$(GR_ROUTINES) $(DISPATCH_ROUTINE) $(DRIVERS) $(SYSTEM_ROUTINES)
$(SHARED_LD) `ls $(PG_ROUTINES) \
$(PG_NON_STANDARD) $(GR_ROUTINES) $(DISPATCH_ROUTINE) \
$(DRIVERS) $(SYSTEM_ROUTINES) | sort | uniq` $(SHARED_LIB_LIBS)
EOD
fi
cat >> makefile << \EOD
#-----------------------------------------------------------------------
# libpgobs.a contains obsolete routines used by some programs
#-----------------------------------------------------------------------
libpgobs.a : $(OBSOLETE_ROUTINES)
ar ru libpgobs.a $(OBSOLETE_ROUTINES)
$(RANLIB) libpgobs.a
#-----------------------------------------------------------------------
# Target "prog" is used to make the demo programs. They can also be made
# individually.
#-----------------------------------------------------------------------
prog: $(DEMOS)
EOD
# If the default pgplot library is shareable then the demos do not
# need to be recompiled. If there is no shareable library then they
# do, so add an extra dependency.
if test ! \( -n "$SHARED_LIB" -a -n "$SHARED_LD" \); then
EXTRA_DEPENDENCY="libpgplot.a"
fi
for file in $DEMOS; do
echo "${file}: \$(DEMDIR)/${file}.f $EXTRA_DEPENDENCY"
echo " \$(FCOMPL) \$(FFLAGD) -o ${file} \$(DEMDIR)/${file}.f \$(PGPLOT_LIB) \$(LIBS)"
done >> makefile
cat >> makefile << \EOD
#-----------------------------------------------------------------------
# Target "grfont.dat" is the binary font file.
# This is created from grfont.txt with the "pgpack" program.
# (a) compile the `pgpack' program; then
# (b) run `pgpack' to convert the ASCII version of the font file
# (grfont.txt) into the binary version (grfont.dat). When executed,
# `pgpack' should report:
# Characters defined: 996
# Array cells used: 26732
#-----------------------------------------------------------------------
EOD
(
if test -f $SYSDIR/pgpack.f; then
echo "grfont.dat: \$(FNTDIR)/grfont.txt \$(SYSDIR)/pgpack.f"
echo " \$(FCOMPL) \$(FFLAGC) -o pgpack \$(SYSDIR)/pgpack.f"
elif test -f $SYSDIR/pgpack.c; then
echo "grfont.dat: \$(FNTDIR)/grfont.txt \$(SYSDIR)/pgpack.c"
echo " \$(CCOMPL) \$(CFLAGC) -o pgpack \$(SYSDIR)/pgpack.c"
elif test -f $SYSDIR/pgpack.m; then
echo "grfont.dat: \$(FNTDIR)/grfont.txt \$(SYSDIR)/pgpack.m"
echo " \$(MCOMPL) \$(MFLAGC) -o pgpack \$(SYSDIR)/pgpack.m"
else
echo "grfont.dat: \$(FNTDIR)/grfont.txt \$(FNTDIR)/pgpack.f"
echo " \$(FCOMPL) \$(FFLAGC) -o pgpack \$(FNTDIR)/pgpack.f"
fi
echo " rm -f grfont.dat"
echo " ./pgpack <\$(FNTDIR)/grfont.txt"
echo " rm -f pgpack"
) >> makefile
cat >> makefile << \EOD
#-----------------------------------------------------------------------
# Documentation files
#-----------------------------------------------------------------------
EOD
PG_SOURCE=`echo " $PG_ROUTINES $PG_NON_STANDARD" | sed -e 's|\.o|\.f|g' -e 's| pg| $(SRCDIR)/pg|g'`
(
echo "PG_SOURCE=$PG_SOURCE"
echo "pgplot.doc: \$(PG_SOURCE)"
echo " $SRC/makedoc \$(PG_SOURCE) > pgplot.doc"
echo "pgplot.html: \$(PG_SOURCE)"
echo " $SRC/makehtml \$(PG_SOURCE) > pgplot.html"
echo "pgplot.hlp: \$(PG_SOURCE)"
echo " $SRC/makehelp \$(PG_SOURCE) > pgplot.hlp"
echo "pgplot-routines.tex: \$(PG_SOURCE)"
echo " $SRC/maketex \$(PG_SOURCE) > pgplot-routines.tex"
) >> makefile
cat >> makefile << \EOD
#-----------------------------------------------------------------------
# Target "pgxwin_server" is the server program for the XW driver
#-----------------------------------------------------------------------
pgxwin_server: $(DRVDIR)/pgxwin_server.c
$(CCOMPL) $(CFLAGC) $(XINCL) -o pgxwin_server $(DRVDIR)/pgxwin_server.c $(LIBS)
#-----------------------------------------------------------------------
# Target "pgdisp" is the pgdisp server program for /XDISP driver
#-----------------------------------------------------------------------
pgdisp: $(PGDISP_ROUTINES)
$(CCOMPL) $(CFLAGC) -o pgdisp $(PGDISP_ROUTINES) $(LIBS)
#-----------------------------------------------------------------------
# Target "libxmpgplot.a" contains the Motif widget driver.
#-----------------------------------------------------------------------
libXmPgplot.a: XmPgplot.o
ar ru libXmPgplot.a XmPgplot.o
$(RANLIB) libXmPgplot.a
XmPgplot.h: $(XMDIR)/XmPgplot.h
cp $(XMDIR)/XmPgplot.h XmPgplot.h
XmPgplot.o: $(DRVDIR)/pgxwin.h XmPgplot.h $(XMDIR)/XmPgplotP.h $(XMDIR)/XmPgplot.c
$(CCOMPL) -c $(CFLAGC) -I$(DRVDIR) -I$(XMDIR) $(MOTIF_INCL) $(XMDIR)/XmPgplot.c
#-----------------------------------------------------------------------
# Target "libxapgplot.a" contains the Motif widget driver.
#-----------------------------------------------------------------------
libXaPgplot.a: XaPgplot.o
ar ru libXaPgplot.a XaPgplot.o
$(RANLIB) libXaPgplot.a
XaPgplot.h: $(XADIR)/XaPgplot.h
cp $(XADIR)/XaPgplot.h XaPgplot.h
XaPgplot.o: $(DRVDIR)/pgxwin.h XaPgplot.h $(XADIR)/XaPgplotP.h $(XADIR)/XaPgplot.c
$(CCOMPL) -c $(CFLAGC) -I$(DRVDIR) -I$(XADIR) $(MOTIF_INCL) $(XADIR)/XaPgplot.c
#-----------------------------------------------------------------------
# Target "libtkpgplot.a" contains the Tk widget driver.
#-----------------------------------------------------------------------
libtkpgplot.a: tkpgplot.o
ar ru libtkpgplot.a tkpgplot.o
$(RANLIB) libtkpgplot.a
tkpgplot.h: $(TKDIR)/tkpgplot.h
cp $(TKDIR)/tkpgplot.h tkpgplot.h
tkpgplot.o: $(DRVDIR)/pgxwin.h tkpgplot.h $(TKDIR)/tkpgplot.c