xemacs-packages / XEmacs.rules

   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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
# Common Makefile material for package Makefiles
# Copyright (C) 1997 Free Software Foundation Inc.
# Copyright (C) 2002, 2003, 2005 Ben Wing.

# This file is part of XEmacs.

# XEmacs is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any
# later version.

# XEmacs is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.

# You should have received a copy of the GNU General Public License
# along with XEmacs; see the file COPYING.  If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.

# Requires XEmacs 21.0-beta19 or greater and GNU Make 3.78 or greater.

# Settings that a Makefile can specify (all settings need to be done
# BEFORE including XEmacs.rules; if you need something from Local.rules
# in order to determine the settings properly -- e.g. BUILD_WITHOUT_MULE --
# include Local.rules.inc at the top of your Makefile):
#
# At the top of every Makefile:
# -----------------------------
#
# VERSION = 1.10
# MAINTAINER = Joe Shmoe <joe@shmoe.org>, or
# MAINTAINER = XEmacs Development Team <xemacs-beta@xemacs.org>
# PACKAGE = my-package
# PKG_TYPE = regular or single-file (each file is a separate package)
# REQUIRES = list of packages that must be available to compile the .elcs
# CATEGORY = standard, mule, or unsupported
#
# Optionally:
# -----------
#
# AUTHOR_VERSION = 1.4.9
# PACKAGE_SUPPRESS = calls to `package-suppress' to indicate packages that
#  should be available only in particular versions of XEmacs, e.g.:
#
# PACKAGE_SUPPRESS = \
#  (package-suppress 'xemacs-base \"regexp-opt\" '(emacs-version>= 21 5 11)) \
#  (package-suppress 'xemacs-base \"easy-mmode\" '(emacs-version>= 21 5 11))
#
#
# Lisp files:
# -----------
#
# ELCS = .elc files to compile
# ELCS_1 = more .elc files to compile, to be installed in a subdirectory of
#   lisp/
# ELCS_1_DEST = name of subdirectory to install them into; include
#   $(PACKAGE) in the name
# EARLY_GENERATED_LISP = additional .el files that will be generated before
#   any byte-compilation (use this for autoloads-type files); rules must be
#   given to build them
# GENERATED_LISP = additional .el files that will be generated at
#   byte-compilation time; rules must be given to build them
# PRELOADS = additional command-line arguments needed when compiling .elcs
# AUTOLOAD_PATH = subdirectory in source tree where .elcs are located (this
#   is where auto-autoloads.el, etc. will be placed)
#
# Doc files (see below):
# ----------------------
#
# (1) The preferred way:
#
# EXPLICIT_DOCS, STANDARD_DOCS, EXTRA_TEXI_FILES, EXTRA_HTML_FILES,
#   DOCS_TEXINFO_EXTENSION, DOCS_TXI_EXTENSION
#
# (2) The hard way:
#
# TEXI_FILES, INFO_FILES, INFO_DEP, HTML_FILES, HTML_DEP
#
# Also: EXTRA_DOC_FILES
#
# Other files to build:
# ---------------------
#
# EXTRA_DEPENDENCIES = additional files to build; rules must be given to
#   build them
#
# Files to install, besides the .elcs, docs, ChangeLog and _pkg.el:
# -----------------------------------------------------------------
#
# EXTRA_SOURCES = files installed under lisp/$(PACKAGE)
# LIBSRC_FILES = files installed under lib-src/
# DATA_FILES, DATA_DEST = files installed under a subdirectory of etc/; include
#   $(PACKAGE) in the name
# DATA_1_FILES, DATA_1_DEST ... DATA_35_FILES, DATA_35_DEST = files to be
#   installed in other subdirectories of etc/

XEMACS_PACKAGES_BASE := $(shell while [ ! -f XEmacs.rules ]; do \
                                    cd ..;	\
                                done;		\
                                pwd)

include ${XEMACS_PACKAGES_BASE}/Local.rules.inc

# Ensure vanilla locale when building
override LANG := C

# Only in rare cases will you need to override this
ifeq ($(AUTOLOAD_PATH),)
AUTOLOAD_PATH = .
endif

# Set this in the package Makefile if necessary (BEFORE including this file)
EARLY_GENERATED_LISP := $(AUTOLOAD_PATH)/auto-autoloads.el \
	$(AUTOLOAD_PATH)/custom-load.el $(EARLY_GENERATED_LISP)
ifeq ($(XEMACS_21_5),t)
EARLY_GENERATED_LISP += $(AUTOLOAD_PATH)/custom-defines.el
endif

EARLY_GENERATED_ELCS = $(EARLY_GENERATED_LISP:.el=.elc)
GENERATED_ELCS = $(GENERATED_LISP:.el=.elc)

# SOURCE_FILES_TO_COPY = *.el*
SOURCE_FILES_TO_COPY = $(ELCS) $(ELCS:.elc=.el) \
	$(MULE_ELCS) $(MULE_ELCS:.elc=.el) \
	$(EARLY_GENERATED_ELCS) $(EARLY_GENERATED_LISP) \
	$(GENERATED_ELCS) $(GENERATED_LISP) $(AUTOLOAD_PATH)/_pkg.el

# Non configurable portion follows

MANIFEST = pkginfo/MANIFEST.$(PACKAGE)
# This might be a sublevel PWD; that is intentional.  Use
# ${XEMACS_PACKAGES_BASE} for the toplevel directory.
PWD      := $(shell pwd)

.SUFFIXES:
.SUFFIXES: .html .info .txi .texi .texinfo .dvi .ps .pdf .elc .el

# STAGING is the top of the directory tree where a particular package's
# files are installed, or where tarballs are installed using `make bindist'.

# 'make bindist' needs STAGING to be set to NONMULE_INSTALLED_PACKAGES_ROOT
# if we are building a Mule package so we don't end up with 2 package-index
# files. 

ifeq ('$(MAKECMDGOALS)','bindist')
STAGING:= $(NONMULE_INSTALLED_PACKAGES_ROOT)
else
 ifeq ('$(CATEGORY)','mule')
STAGING:= $(MULE_INSTALLED_PACKAGES_ROOT)
 else
STAGING:= $(NONMULE_INSTALLED_PACKAGES_ROOT)
 endif
endif

# We should strive to use XEMACS_BATCH_CLEAN as much as possible, so we have
# no possible contamination from outside packages.  We should rewrite the
# others to load the appropriate autoloads from our own built package tree.

ifeq ($(BUILD_WITHOUT_MULE),t)
LISP_DIRECTORIES= (list lisp-directory)
else
LISP_DIRECTORIES= (list (expand-file-name "mule" lisp-directory) lisp-directory)
endif
XEMACS_BATCH_CLEAN = $(XEMACS) -no-autoloads $(BATCH) -eval '(setq load-path $(LISP_DIRECTORIES))'
# The following works more or less the same and with less fuss, but only in
# 21.5 and above
# XEMACS_BATCH_CLEAN = $(XEMACS) -no-autoloads $(BATCH) -no-packages
XEMACS_BATCH_DIRTY = $(XEMACS) $(BATCH)
LOAD_AUTOLOADS= -eval '(packages-load-package-auto-autoloads load-path)'

#####################################
#            Handle docs            #
#####################################

# If something goes wrong and $(STAGING) is blank, the commands below will
# attempt to install files into absolute paths /lisp/* and /etc/* -- not
# a good idea at all.

check-staging:
ifeq ($(STAGING),)
	$(error STAGING is not set; potential major filesystem trashing!  Fix this)
endif

check-mule:
ifeq ($(CATEGORY),mule)
ifneq ($(BUILD_WITHOUT_MULE),)
	$(error This package needs Mule support in order to be compiled)
endif
endif

# Possibilities for building the docs:
#
# (1) EXPLICIT_DOCS = <texi files>
#     Build the specified .texi files.  Info and HTML files automatically
#     computed from the .texi files.
# (2) STANDARD_DOCS = t
#     Same as EXPLICIT_DOCS = $(PACKAGE).texi
# (3) Manual: Specify TEXI_FILES, INFO_FILES, INFO_DEP, HTML_FILES, and
#     HTML_DEP by yourself.  Do not explicitly add any doc targets to
#     compile::.
#
# When EXPLICIT_DOCS or STANDARD_DOCS is given:
#
# (1) you can specify other .texi files included in the files specified in
#     EXPLICIT_DOCS using EXTRA_TEXI_FILES (they will be listed as
#     dependencies of the info and html files)
# (2) you can specify extra .html output files using EXTRA_HTML_FILES
# (3) you can use `DOCS_TEXINFO_EXTENSION = t' to indicate that the
#     explicitly specified docs have .texinfo as the extension instead of
#    .texi.  Similarly for `DOCS_TXI_EXTENSION = t'.
#
# You can also specify EXTRA_DOC_FILES in all cases to indicate extra files
# to be copied into the man/ directory at installation time.

ifeq ($(STANDARD_DOCS),t)
EXPLICIT_DOCS = $(PACKAGE).texi
endif

ifneq ($(EXPLICIT_DOCS),)
ifeq ($(DOCS_TEXINFO_EXTENSION),t)
EXPLICIT_DOCS_AS_TEXI=$(EXPLICIT_DOCS:%.texinfo=%.texi)
else
ifeq ($(DOCS_TXI_EXTENSION),t)
EXPLICIT_DOCS_AS_TEXI=$(EXPLICIT_DOCS:%.txi=%.texi)
else
EXPLICIT_DOCS_AS_TEXI=$(EXPLICIT_DOCS)
endif
endif

# Ensure the correct setting of $TEXI_FILES. --SY.
TEXI_FILES = $(EXPLICIT_DOCS)
ifeq ($(DOCS_TEXINFO_EXTENSION),t)
  TEXI_FILES = $(EXPLICIT_DOCS_AS_TEXI:%.texi=%.texinfo)
endif
ifeq ($(DOCS_TXI_EXTIONSION),t)
  TEXI_FILES = $(EXPLICIT_DOCS_AS_TEXI:%.texi=%.txi)
endif

TEXI_FILES += $(EXTRA_TEXI_FILES)
INFO_FILES = $(EXPLICIT_DOCS_AS_TEXI:%.texi=%.info*)
INFO_DEP = $(EXPLICIT_DOCS_AS_TEXI:%.texi=%.info)

$(INFO_DEP): $(EXTRA_TEXI_FILES)

mostlyclean::
	rm -f $(EXPLICIT_DOCS_AS_TEXI:%.texi=%.toc) \
	$(EXPLICIT_DOCS_AS_TEXI:%.texi=%.aux) \
	$(EXPLICIT_DOCS_AS_TEXI:%.texi=%.oaux) \
	$(EXPLICIT_DOCS_AS_TEXI:%.texi=%.log) \
	$(EXPLICIT_DOCS_AS_TEXI:%.texi=%.cp) \
	$(EXPLICIT_DOCS_AS_TEXI:%.texi=%.cps) \
	$(EXPLICIT_DOCS_AS_TEXI:%.texi=%.fn) \
	$(EXPLICIT_DOCS_AS_TEXI:%.texi=%.fns) \
	$(EXPLICIT_DOCS_AS_TEXI:%.texi=%.tp) \
	$(EXPLICIT_DOCS_AS_TEXI:%.texi=%.tps) \
	$(EXPLICIT_DOCS_AS_TEXI:%.texi=%.vr) \
	$(EXPLICIT_DOCS_AS_TEXI:%.texi=%.vrs) \
	$(EXPLICIT_DOCS_AS_TEXI:%.texi=%.pg) \
	$(EXPLICIT_DOCS_AS_TEXI:%.texi=%.pgs) \
	$(EXPLICIT_DOCS_AS_TEXI:%.texi=%.ky) \
	$(EXPLICIT_DOCS_AS_TEXI:%.texi=%.kys)

clean::
	rm -f $(EXPLICIT_DOCS_AS_TEXI:%.texi=%.dvi) \
	$(EXPLICIT_DOCS_AS_TEXI:%.texi=%.ps)

HTML_FILES = $(EXPLICIT_DOCS_AS_TEXI:%.texi=%*.html) $(EXTRA_HTML_FILES)
HTML_DEP = $(EXPLICIT_DOCS_AS_TEXI:%.texi=%_toc.html)

$(HTML_DEP): $(EXTRA_TEXI_FILES)

endif

html: $(HTML_DEP)

XEMACS_BATCH_PREPARE_FOR_TEXINFO = $(XEMACS_BATCH_CLEAN) -eval '(setq load-path (append (list "$(XEMACS_PACKAGES_BASE)/xemacs-packages/texinfo" "$(XEMACS_PACKAGES_BASE)/xemacs-packages/text-modes" "$(XEMACS_PACKAGES_BASE)/xemacs-packages/xemacs-base") load-path))' $(LOAD_AUTOLOADS)

FORMAT_INFO_USING_XEMACS_ARGS = -l informat -l texinfmt -f texinfo-format-buffer

FORMAT_INFO_USING_XEMACS = \
	$(XEMACS_BATCH_PREPARE_FOR_TEXINFO) -insert $< \
	$(FORMAT_INFO_USING_XEMACS_ARGS) -f save-buffer

FORMAT_MULE_INFO_USING_XEMACS = \
	$(XEMACS_BATCH_PREPARE_FOR_TEXINFO) -insert $< \
		-eval '(unless (featurep (quote mule)) (kill-emacs 0))' \
		-eval '(cd "$(<D)")' \
		$(FORMAT_INFO_USING_XEMACS_ARGS) \
		-eval '(setq file-coding-system (quote iso-2022-7))' \
		-eval '(save-buffer 0)'

# makeinfo doesn't seem able to handle Mule-formatted files correctly, so
# we need to use the texinfo package. #### Switch to UTF-8 and this should
# go away.
ifeq ($(COMPILE_INFO_AS_MULE),t)
FORMAT_INFO = $(FORMAT_MULE_INFO_USING_XEMACS)
else
FORMAT_INFO = cd $(@D) && $(MAKEINFO) $(MAKEINFO_FLAGS) -o $(@F) $(<F)
endif

%-ja.info: %-ja.texi
	$(FORMAT_MULE_INFO_USING_XEMACS)

%.info: %.txi
	$(FORMAT_INFO)
%.info: %.texi
	$(FORMAT_INFO)
%.info: %.texinfo
	$(FORMAT_INFO)

## Make sure to cd into the directory before running texi2html because it
## puts its results in the current directory, not the directory of the
## source file.

#	V 1.56k (with Cygwin) does not allow -p flag.  Works fine without it.
#RUN_TEXI2HTML = cd $(@D) && $(TEXI2HTML) $(TEXI2HTML_FLAGS) -p $(<F)
RUN_TEXI2HTML = cd $(@D) && $(TEXI2HTML) $(TEXI2HTML_FLAGS) $(<F)

%_toc.html: %.txi
	$(RUN_TEXI2HTML)
%_toc.html: %.texi
	$(RUN_TEXI2HTML)
%_toc.html: %.texinfo
	$(RUN_TEXI2HTML)

# #### I'm not sure if this is correct.  xslt-process seems to think it
# needs to be run twice.
ifneq ($(TEXI2DVI),)
RUN_TEXI2DVI = cd $(@D) && $(TEXI2DVI) $(<F) && $(TEXI2DVI) $(<F)
else
RUN_TEXI2DVI = -
endif

%.dvi: %.txi
	$(RUN_TEXI2DVI)
%.dvi: %.texi
	$(RUN_TEXI2DVI)
%.dvi: %.texinfo
	$(RUN_TEXI2DVI)

ifneq ($(TEXI2PDF),)
RUN_TEXI2PDF = cd $(@D) && $(TEXI2PDF) $(<F)
else
RUN_TEXI2PDF = -
endif

%.pdf: %.txi
	$(RUN_TEXI2PDF)
%.pdf: %.texi
	$(RUN_TEXI2PDF)
%.pdf: %.texinfo
	$(RUN_TEXI2PDF)

ifneq ($(DVIPS),)
RUN_DVIPS = cd $(@D) && $(DVIPS) -o $(@F) $(<F)
else
RUN_DVIPS = -
endif

%.ps: %.dvi
	$(RUN_DVIPS)

ifeq ($(XEMACS_NATIVE_NT),t)
# Convert UNIX-path (containing output of `pwd') to windows-path, so
# that XEmacs native NT can handle it.
PACKAGE_COMPILE = \
"$(shell cygpath --windows $(XEMACS_PACKAGES_BASE)/package-compile.el)"
PACKAGE_CLEAN = \
"$(shell cygpath --windows $(XEMACS_PACKAGES_BASE)/package-clean.el)"
PACKAGE_NET_PACKAGES = \
"$(shell cygpath --windows $(XEMACS_PACKAGES_BASE)/package-net-packages.el)"
PACKAGE_STAGING = \
"$(shell cygpath --windows $(STAGING))"
else
PACKAGE_COMPILE = $(XEMACS_PACKAGES_BASE)/package-compile.el
PACKAGE_CLEAN = $(XEMACS_PACKAGES_BASE)/package-clean.el
PACKAGE_NET_PACKAGES = $(XEMACS_PACKAGES_BASE)/package-net-packages.el
PACKAGE_STAGING = $(STAGING)
endif

# Behaves like an XEmacs with the required packages set up
BOOT_XEMACS= $(XEMACS_BATCH_CLEAN) -l $(PACKAGE_COMPILE) -- $(REQUIRES) -- $(PRELOADS)

%.elc: %.el
	$(BOOT_XEMACS) -f batch-byte-compile $<

# compile must be :: because some packages (e.g. psgml-dtd?) put separate
# commands that apply only to those particular dependencies.
compile:: check-mule

# Build the generated stuff if we're in the top-level of a package directory
# but not otherwise.
ifneq ($(PACKAGE),)
compile:: $(AUTOLOAD_PATH)/_pkg.el
endif

## first, the byte-compile the files generated earlier (auto-autoloads.el,
## etc.), now that we have all of them and hence can handle dependencies.
## then, generate and compile the other generated files.
compile:: $(EARLY_GENERATED_ELCS) $(GENERATED_ELCS)

## now compile the main Lisp
compile:: $(ELCS) $(ELCS_1)

## now the docs, info format.
compile:: $(INFO_DEP)

## now the docs, html format (maybe).
ifeq ($(INSTALL_HTML),t)
compile:: html
endif

## now, any extra dependencies specified by the Makefiles.
compile:: $(EXTRA_DEPENDENCIES)

dist:: binkit package-info

mostlyclean::

# Remove the generated files.
genclean:
	rm -f $(GENERATED_LISP) $(EARLY_GENERATED_LISP) $(GENERATED_ELCS) $(EARLY_GENERATED_ELCS) package-info $(AUTOLOAD_PATH)/_pkg.el

clean:: mostlyclean
	rm -f $(GENERATED_ELCS) $(EARLY_GENERATED_ELCS) $(ELCS) $(ELCS_1) \
	$(HTML_FILES) $(INFO_FILES) $(DEPENDS_FILE_NAME) $(EXTRA_DEPENDENCIES)

# distclean is what you use when making a distribution.  everything that
# can get rebuilt should be killed.  everything.

distclean:: clean genclean

# extraclean means distclean plus removal of backup files, etc.
extraclean: distclean
	rm -f core *~ .*~ .\#*

# [[ elcclean is for when you want to rebuild after having made a small
# change, e.g. you cvs updated and got new versions of some files.
# The problem is that if you just `make', you may have the situation
# where a file that needs to be compiled depends on some other
# just-updated .el file, and in particular on the features that were
# added in the update.  In such a case, the .elc file is out-of-date
# w.r.t the .el file, and you'd get the .elc file (missing the
# necessary features), and error.  So we remove the minimum number of
# .elc required to ensure that the build will always succeed
# correctly. ]]

# This is less of an issue now that we ignore out-of-date .elc files. --ben

elcclean:
	$(XEMACS_BATCH_CLEAN) -l $(PACKAGE_CLEAN)

GENERATED_ELC_DEPENDENCIES = $(ELCS:.elc=.el) $(ELCS_1:.elc=.el) \
	$(AUTOLOAD_PATH)/_pkg.el

# If Makefile or _pkg.el has changed (Makefile will trigger _pkg.el
# rebuilding), then our suppress forms may have changed.  Just rebuilding
# the autoload file normally isn't enough as the old suppress forms will
# still sit there, so nuke it first.
$(AUTOLOAD_PATH)/auto-autoloads.el :: $(AUTOLOAD_PATH)/_pkg.el
	rm -f $(AUTOLOAD_PATH)/auto-autoloads.el

ifeq ($(XEMACS_21_5),t)
$(AUTOLOAD_PATH)/auto-autoloads.el :: $(GENERATED_ELC_DEPENDENCIES)
	$(XEMACS_BATCH_CLEAN) $(LOAD_AUTOLOADS) \
		-l autoload -f batch-update-directory-autoloads \
		$(PACKAGE) $(AUTOLOAD_PATH)
	# The equivalent of `touch' is done automatically
	@rm -f $(AUTOLOAD_PATH)/auto-autoloads.el~

$(AUTOLOAD_PATH)/custom-defines.el : $(GENERATED_ELC_DEPENDENCIES)
	$(XEMACS_BATCH_CLEAN) $(LOAD_AUTOLOADS) \
		-l autoload -f batch-update-directory-custom-defines \
		$(PACKAGE) $(AUTOLOAD_PATH)
	@rm -f $(AUTOLOAD_PATH)/custom-defines.el~

else
AUTOLOAD_PACKAGE_NAME = (setq autoload-package-name \"$(PACKAGE)\")
AUTOLOAD_FILE = (setq generated-autoload-file \
	\"$(AUTOLOAD_PATH)/auto-autoloads.el\")

$(AUTOLOAD_PATH)/auto-autoloads.el :: $(GENERATED_ELC_DEPENDENCIES)
	$(XEMACS_BATCH_CLEAN) $(LOAD_AUTOLOADS) \
		-eval "$(AUTOLOAD_PACKAGE_NAME)" \
		-eval "$(AUTOLOAD_FILE)" \
		-l autoload -f batch-update-autoloads $^
	@touch $(AUTOLOAD_PATH)/auto-autoloads.el
	@rm -f $(AUTOLOAD_PATH)/auto-autoloads.el~
endif

$(AUTOLOAD_PATH)/custom-load.el : $(GENERATED_ELC_DEPENDENCIES)
	$(XEMACS_BATCH_CLEAN) $(LOAD_AUTOLOADS) -l cus-dep \
		-f Custom-make-dependencies $(AUTOLOAD_PATH)
	@touch $(AUTOLOAD_PATH)/custom-load.el
	@rm -f $(AUTOLOAD_PATH)/custom-load.el~

pkg_tar = $(STAGING)/$(PACKAGE)-$(VERSION)-pkg.tar

ifeq ($(XEMACS_NATIVE_NT),t)
# Convert UNIX-path (containing output of `pwd') to windows-path,
# so that XEmacs native NT can handle it.
PKG_TAR_GZ = "$(shell cygpath --windows $(pkg_tar)).gz"
PACKAGE_INFO = "$(shell cygpath --windows $(STAGING)/$(PACKAGE_INDEX))"
else
PKG_TAR_GZ = $(pkg_tar).gz
PACKAGE_INFO = $(STAGING)/$(PACKAGE_INDEX)
endif

# Make the $(pkg_tar).gz first, then the $(pkg_tar).bz2
package-info : package-info.in Makefile $(AUTOLOAD_PATH)/_pkg.el \
		$(pkg_tar).gz $(pkg_tar).bz2
        #  #### See if we can't CLEAN this up
	$(XEMACS_BATCH_DIRTY) \
		-l package-info.elc -f batch-update-package-info \
		'$(VERSION)' $(PKG_TAR_GZ) \
		'$(REQUIRES)' \
		'$(AUTHOR_VERSION)' '$(MAINTAINER)' '$(CATEGORY)'
        #  #### See if we can't CLEAN this up
	$(XEMACS_BATCH_DIRTY) \
		-l ../../hack-package-index.el -f batch-hack-package-index \
			$(PACKAGE) package-info $(PACKAGE_INFO) $(CATEGORY)

ifeq ($(BUILD_TARS),t)
$(pkg_tar): $(STAGING)/$(MANIFEST)
	@(cd $(STAGING);			\
	   rm -f $(pkg_tar)*)

	(cd $(STAGING);				\
	  $(TAR) $(EXCLUDES) --create --owner=0 --group=0 --file $(pkg_tar) \
		`cat $(MANIFEST)`)


$(pkg_tar).gz: $(pkg_tar)
ifneq ($(BZIP2),) # need to leave behind the .tar for bzip2 to find.
	(cd $(STAGING);				\
	  gzip -cv9 $(pkg_tar) > $(pkg_tar).gz;)
else # BZIP2 is ''
	(cd $(STAGING);				\
	  gzip -v9 $(pkg_tar);)
endif

ifneq ($(BZIP2),)
$(pkg_tar).bz2: $(pkg_tar)
	(cd $(STAGING);				\
	  $(BZIP2) -v9 $(pkg_tar);)
else # Don't build a .tar.bz2
$(pkg_tar).bz2:

.PHONY: $(pkg_tar).bz2
endif # BZIP2 ?

else # when BUILD_TARS  is ''
# Touch the file so the package-index can be generated
$(pkg_tar) $(pkg_tar).gz $(pkg_tar).bz2 :
	touch $@
endif # BUILD_TARS ?

ifeq ($(AUTHOR_VERSION),)
AUTHOR_VERSION = No-Upstream-Ver
endif

$(AUTOLOAD_PATH)/_pkg.el: Makefile
	@echo Creating $(AUTOLOAD_PATH)/_pkg.el
	@echo ";;;###autoload" > $(AUTOLOAD_PATH)/_pkg.el
	@echo "(package-provide '$(PACKAGE)" >> $(AUTOLOAD_PATH)/_pkg.el
	@echo "		 :version $(VERSION)" >> $(AUTOLOAD_PATH)/_pkg.el
	@echo "          :author-version \"$(AUTHOR_VERSION)\"" >> $(AUTOLOAD_PATH)/_pkg.el
	@echo "		 :type '$(PKG_TYPE))" >> $(AUTOLOAD_PATH)/_pkg.el
ifneq ($(PACKAGE_SUPPRESS),)
	@echo "" >> $(AUTOLOAD_PATH)/_pkg.el
	@echo ";;;###autoload" >> $(AUTOLOAD_PATH)/_pkg.el
	@echo "(when (fboundp 'package-suppress)" >> $(AUTOLOAD_PATH)/_pkg.el
	@echo "      $(PACKAGE_SUPPRESS)" >> $(AUTOLOAD_PATH)/_pkg.el
	@echo ")" >> $(AUTOLOAD_PATH)/_pkg.el
endif

setup-info: #  #### See if we can't CLEAN this up
	$(XEMACS_BATCH_DIRTY) -l $(PACKAGE_NET_PACKAGES) \
		-l $(PACKAGE_INFO) \
		-f package-net-packages-batch-convert-index-to-ini $(PACKAGE_STAGING) $(CATEGORY)

.PHONY: binkit-with-html install-for-bindist autoloads

# A target that _only_ installs and doesn't build _anything_
install-only: binkit

binkit: binkit-1

ifeq ($(INSTALL_HTML),t)
binkit:: install-html
endif

binkit-with-html: binkit-1 install-html

install-for-bindist: binkit package-info setup-info

## Do not byte-compile as that could require stuff from elsewhere, and you
## get dependency circles.
autoloads: $(EARLY_GENERATED_LISP)

binkit-1: check-staging
	(if test -d $(STAGING); then		\
		cd $(STAGING);			\
		if test -f $(MANIFEST); then	\
			rm -rf `cat $(MANIFEST)`; \
		fi;				\
	fi;)
ifneq ($(PACKAGE),)
	@-mkdir -p $(STAGING)/lisp/$(PACKAGE)
endif
ifneq ($(ELCS_1),)
	@-mkdir -p $(STAGING)/lisp/$(ELCS_1_DEST)
endif
ifneq ($(INFO_FILES),)
	@-mkdir -p $(STAGING)/info
	@-mkdir -p $(STAGING)/man/$(PACKAGE)
endif
ifneq ($(DATA_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_DEST)
endif
ifneq ($(DATA_1_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_1_DEST)
endif
ifneq ($(DATA_2_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_2_DEST)
endif
ifneq ($(DATA_3_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_3_DEST)
endif
ifneq ($(DATA_4_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_4_DEST)
endif
ifneq ($(DATA_5_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_5_DEST)
endif
ifneq ($(DATA_6_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_6_DEST)
endif
ifneq ($(DATA_7_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_7_DEST)
endif
ifneq ($(DATA_8_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_8_DEST)
endif
ifneq ($(DATA_9_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_9_DEST)
endif
ifneq ($(DATA_10_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_10_DEST)
endif
ifneq ($(DATA_11_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_11_DEST)
endif
ifneq ($(DATA_12_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_12_DEST)
endif
ifneq ($(DATA_13_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_13_DEST)
endif
ifneq ($(DATA_14_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_14_DEST)
endif
ifneq ($(DATA_15_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_15_DEST)
endif
ifneq ($(DATA_16_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_16_DEST)
endif
ifneq ($(DATA_17_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_17_DEST)
endif
ifneq ($(DATA_18_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_18_DEST)
endif
ifneq ($(DATA_19_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_19_DEST)
endif
ifneq ($(DATA_20_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_20_DEST)
endif
ifneq ($(DATA_21_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_21_DEST)
endif
ifneq ($(DATA_22_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_22_DEST)
endif
ifneq ($(DATA_23_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_23_DEST)
endif
ifneq ($(DATA_24_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_24_DEST)
endif
ifneq ($(DATA_25_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_25_DEST)
endif
ifneq ($(DATA_26_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_26_DEST)
endif
ifneq ($(DATA_27_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_27_DEST)
endif
ifneq ($(DATA_28_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_28_DEST)
endif
ifneq ($(DATA_29_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_29_DEST)
endif
ifneq ($(DATA_30_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_30_DEST)
endif
ifneq ($(DATA_31_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_31_DEST)
endif
ifneq ($(DATA_32_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_32_DEST)
endif
ifneq ($(DATA_33_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_33_DEST)
endif
ifneq ($(DATA_34_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_34_DEST)
endif
ifneq ($(DATA_35_FILES),)
	@-mkdir -p $(STAGING)/etc/$(DATA_35_DEST)
endif
ifneq ($(LIBSRC_FILES),)
	@-mkdir -p $(STAGING)/lib-src
endif
	@-mkdir -p $(STAGING)/pkginfo
ifneq ($(PACKAGE),)
	$(RCOPY) $(addprefix $(PWD)/, ChangeLog $(SOURCE_FILES_TO_COPY) $(EXTRA_SOURCES)) \
	  $(STAGING)/lisp/$(PACKAGE)
endif
ifneq ($(ELCS_1),)
	$(RCOPY) $(addprefix $(PWD)/, $(ELCS_1_FILES)) $(STAGING)/lisp/$(ELCS_1_DEST)
endif
ifneq ($(INFO_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(INFO_FILES)) $(STAGING)/info
	$(RCOPY) $(addprefix $(PWD)/, $(TEXI_FILES)) $(STAGING)/man/$(PACKAGE)
ifneq ($(EXTRA_DOC_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(EXTRA_DOC_FILES)) $(STAGING)/man/$(PACKAGE)
endif
endif
ifneq ($(DATA_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_FILES)) $(STAGING)/etc/$(DATA_DEST)
endif
ifneq ($(DATA_1_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_1_FILES)) $(STAGING)/etc/$(DATA_1_DEST)
endif
ifneq ($(DATA_2_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_2_FILES)) $(STAGING)/etc/$(DATA_2_DEST)
endif
ifneq ($(DATA_3_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_3_FILES)) $(STAGING)/etc/$(DATA_3_DEST)
endif
ifneq ($(DATA_4_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_4_FILES)) $(STAGING)/etc/$(DATA_4_DEST)
endif
ifneq ($(DATA_5_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_5_FILES)) $(STAGING)/etc/$(DATA_5_DEST)
endif
ifneq ($(DATA_6_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_6_FILES)) $(STAGING)/etc/$(DATA_6_DEST)
endif
ifneq ($(DATA_7_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_7_FILES)) $(STAGING)/etc/$(DATA_7_DEST)
endif
ifneq ($(DATA_8_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_8_FILES)) $(STAGING)/etc/$(DATA_8_DEST)
endif
ifneq ($(DATA_9_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_9_FILES)) $(STAGING)/etc/$(DATA_9_DEST)
endif
ifneq ($(DATA_10_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_10_FILES)) $(STAGING)/etc/$(DATA_10_DEST)
endif
ifneq ($(DATA_11_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_11_FILES)) $(STAGING)/etc/$(DATA_11_DEST)
endif
ifneq ($(DATA_12_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_12_FILES)) $(STAGING)/etc/$(DATA_12_DEST)
endif
ifneq ($(DATA_13_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_13_FILES)) $(STAGING)/etc/$(DATA_13_DEST)
endif
ifneq ($(DATA_14_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_14_FILES)) $(STAGING)/etc/$(DATA_14_DEST)
endif
ifneq ($(DATA_15_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_15_FILES)) $(STAGING)/etc/$(DATA_15_DEST)
endif
ifneq ($(DATA_16_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_16_FILES)) $(STAGING)/etc/$(DATA_16_DEST)
endif
ifneq ($(DATA_17_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_17_FILES)) $(STAGING)/etc/$(DATA_17_DEST)
endif
ifneq ($(DATA_18_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_18_FILES)) $(STAGING)/etc/$(DATA_18_DEST)
endif
ifneq ($(DATA_19_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_19_FILES)) $(STAGING)/etc/$(DATA_19_DEST)
endif
ifneq ($(DATA_20_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_20_FILES)) $(STAGING)/etc/$(DATA_20_DEST)
endif
ifneq ($(DATA_21_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_21_FILES)) $(STAGING)/etc/$(DATA_21_DEST)
endif
ifneq ($(DATA_22_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_22_FILES)) $(STAGING)/etc/$(DATA_22_DEST)
endif
ifneq ($(DATA_23_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_23_FILES)) $(STAGING)/etc/$(DATA_23_DEST)
endif
ifneq ($(DATA_24_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_24_FILES)) $(STAGING)/etc/$(DATA_24_DEST)
endif
ifneq ($(DATA_25_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_25_FILES)) $(STAGING)/etc/$(DATA_25_DEST)
endif
ifneq ($(DATA_26_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_26_FILES)) $(STAGING)/etc/$(DATA_26_DEST)
endif
ifneq ($(DATA_27_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_27_FILES)) $(STAGING)/etc/$(DATA_27_DEST)
endif
ifneq ($(DATA_28_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_28_FILES)) $(STAGING)/etc/$(DATA_28_DEST)
endif
ifneq ($(DATA_29_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_29_FILES)) $(STAGING)/etc/$(DATA_29_DEST)
endif
ifneq ($(DATA_30_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_30_FILES)) $(STAGING)/etc/$(DATA_30_DEST)
endif
ifneq ($(DATA_31_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_31_FILES)) $(STAGING)/etc/$(DATA_31_DEST)
endif
ifneq ($(DATA_32_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_32_FILES)) $(STAGING)/etc/$(DATA_32_DEST)
endif
ifneq ($(DATA_33_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_33_FILES)) $(STAGING)/etc/$(DATA_33_DEST)
endif
ifneq ($(DATA_34_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_34_FILES)) $(STAGING)/etc/$(DATA_34_DEST)
endif
ifneq ($(DATA_35_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(DATA_35_FILES)) $(STAGING)/etc/$(DATA_35_DEST)
endif
ifneq ($(LIBSRC_FILES),)
	$(RCOPY) $(addprefix $(PWD)/, $(LIBSRC_FILES)) $(STAGING)/lib-src
endif
	(cd $(STAGING); \
	ls -1 $(MANIFEST) > $(MANIFEST))
ifneq ($(PACKAGE),)
	@(cd $(STAGING); \
	ls -1 lisp/$(PACKAGE)/ChangeLog \
		$(patsubst %, lisp/$(PACKAGE)/%, $(notdir $(SOURCE_FILES_TO_COPY))) \
		$(patsubst %, lisp/$(PACKAGE)/%, $(notdir $(EXTRA_SOURCES))) \
		>> $(MANIFEST))
endif
ifneq ($(ELCS_1),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, lisp/$(ELCS_1_DEST)/%, $(notdir $(ELCS_1_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(INFO_FILES),)
	@(cd $(STAGING); \
	ls -1 man/$(PACKAGE)/* \
		$(patsubst %,info/%, $(notdir $(INFO_FILES))) >> $(MANIFEST))
endif
ifneq ($(DATA_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_DEST)/%, $(notdir $(DATA_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_1_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_1_DEST)/%, $(notdir $(DATA_1_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_2_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_2_DEST)/%, $(notdir $(DATA_2_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_3_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_3_DEST)/%, $(notdir $(DATA_3_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_4_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_4_DEST)/%, $(notdir $(DATA_4_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_5_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_5_DEST)/%, $(notdir $(DATA_5_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_6_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_6_DEST)/%, $(notdir $(DATA_6_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_7_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_7_DEST)/%, $(notdir $(DATA_7_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_8_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_8_DEST)/%, $(notdir $(DATA_8_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_9_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_9_DEST)/%, $(notdir $(DATA_9_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_10_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_10_DEST)/%, $(notdir $(DATA_10_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_11_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_11_DEST)/%, $(notdir $(DATA_11_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_12_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_12_DEST)/%, $(notdir $(DATA_12_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_13_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_13_DEST)/%, $(notdir $(DATA_13_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_14_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_14_DEST)/%, $(notdir $(DATA_14_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_15_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_15_DEST)/%, $(notdir $(DATA_15_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_16_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_16_DEST)/%, $(notdir $(DATA_16_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_17_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_17_DEST)/%, $(notdir $(DATA_17_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_18_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_18_DEST)/%, $(notdir $(DATA_18_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_19_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_19_DEST)/%, $(notdir $(DATA_19_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_20_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_20_DEST)/%, $(notdir $(DATA_20_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_21_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_21_DEST)/%, $(notdir $(DATA_21_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_22_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_22_DEST)/%, $(notdir $(DATA_22_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_23_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_23_DEST)/%, $(notdir $(DATA_23_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_24_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_24_DEST)/%, $(notdir $(DATA_24_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_25_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_25_DEST)/%, $(notdir $(DATA_25_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_26_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_26_DEST)/%, $(notdir $(DATA_26_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_27_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_27_DEST)/%, $(notdir $(DATA_27_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_28_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_28_DEST)/%, $(notdir $(DATA_28_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_29_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_29_DEST)/%, $(notdir $(DATA_29_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_30_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_30_DEST)/%, $(notdir $(DATA_30_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_31_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_31_DEST)/%, $(notdir $(DATA_31_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_32_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_32_DEST)/%, $(notdir $(DATA_32_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_33_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_33_DEST)/%, $(notdir $(DATA_33_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_34_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_34_DEST)/%, $(notdir $(DATA_34_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(DATA_35_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %, etc/$(DATA_35_DEST)/%, $(notdir $(DATA_35_FILES))) \
		>> $(MANIFEST))
endif
ifneq ($(LIBSRC_FILES),)
	@(cd $(STAGING); \
	ls -1 $(patsubst %,lib-src/%, $(notdir $(LIBSRC_FILES))) >> $(MANIFEST))
endif

install-html: html check-staging
ifneq ($(HTML_FILES),)
	@-mkdir -p $(STAGING)/html
	@-mkdir -p $(STAGING)/pkginfo
	$(RCOPY) $(addprefix $(PWD)/, $(HTML_FILES)) $(STAGING)/html
	@(cd $(STAGING); \
	ls -1 $(patsubst %,html/%, $(notdir $(HTML_FILES))) >> $(MANIFEST))
endif

# Export dependencies for outer make file usage

# Passed in from outer Make
TARGET_BASE=

# Build depends is a clean version of Requires
BDEPENDS=$(strip $(filter-out $(PACKAGE),$(REQUIRES)))

$(DEPENDS_FILE_NAME): Makefile $(XEMACS_PACKAGES_BASE)/XEmacs.rules
ifneq ($(TARGET_BASE),)
	-rm -f $(DEPENDS_FILE_NAME)
	@echo Creating $(DEPENDS_FILE_NAME)
	@echo > $(DEPENDS_FILE_NAME)
ifneq ($(BDEPENDS),)
	@echo $(TARGET_BASE)$(PACKAGE)/autoloads.target: \
		$(TARGET_BASE)$(BDEPENDS:=/autoloads.target) \
		>>$(DEPENDS_FILE_NAME)
	@echo $(TARGET_BASE)$(PACKAGE)/compile.target: \
		$(TARGET_BASE)$(BDEPENDS:=/compile.target) \
		>>$(DEPENDS_FILE_NAME)
endif
endif

# Local Variables:
# mode: makefile
# End:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.