This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Metaconfig documentation update (part 2)
[metaconfig.git] / U.check / Makefile.SH
1 case $CONFIG in
2 '')
3         if test -f config.sh; then TOP=.;
4         elif test -f ../config.sh; then TOP=..;
5         elif test -f ../../config.sh; then TOP=../..;
6         elif test -f ../../../config.sh; then TOP=../../..;
7         elif test -f ../../../../config.sh; then TOP=../../../..;
8         else
9                 echo "Can't find config.sh."; exit 1
10         fi
11         . $TOP/config.sh
12         ;;
13 esac
14 : This forces SH files to create target in same directory as SH file.
15 : This is so that make DEPEND always knows where to find SH derivatives.
16 case "$0" in
17 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
18 esac
19 echo "Extracting Makefile (with variable substitutions)"
20 : This section of the file will have variable substitutions done on it.
21 : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
22 : Protect any dollar signs and backticks that you do not want interpreted
23 : by putting a backslash in front.  You may delete these comments.
24 $spitshell >Makefile <<!GROK!THIS!
25 CC = $cc
26 CCFLAGS = $ccflags
27 OPTIMIZE = $optimize
28 CPPFLAGS = $cppflags
29 MKDEP = $NONONOmkdep
30 !GROK!THIS!
31
32 : In the following dollars and backticks do not need the extra backslash.
33 $spitshell >>Makefile <<'!NO!SUBS!'
34
35 all:    dummy main
36         ./dummy
37         ./main
38
39 main:   try1.o try2.o main.o
40         $(CC) -o main main.o try1.o try2.o
41 test:
42         ./main
43 clean:  
44         rm -f dummy config.h core config.sh
45         rm -f try try?.o main.o main core
46
47 realclean:      clean
48         rm -f Wanted Obsolete check.extra check.wanted build.log
49         rm -f Makefile
50
51 try1.o: try1.c config.h
52
53 try2.o: try2.c config.h
54
55 main.o: main.c config.h
56
57 DEPEND:         
58         $(MKDEP) $(CPPFLAGS) -- try1.c try2.c main.c 
59 !NO!SUBS!
60 chmod 755 Makefile
61 $eunicefix Makefile