Fool-proofing Makefiles
[openssl.git] / tools / Makefile
1 #
2 # SSLeay/tools/Makefile
3 #
4
5 DIR=    tools
6 TOP=    ..
7 CC=     cc
8 INCLUDES= -I$(TOP) -I../../include
9 CFLAG=-g
10 MAKEDEPPROG=    makedepend
11 MAKEDEPEND=     $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
12 MAKEFILE=       Makefile
13
14 CFLAGS= $(INCLUDES) $(CFLAG)
15
16 GENERAL=Makefile
17 TEST=
18 APPS= c_rehash
19 MISC_APPS= c_hash c_info c_issuer c_name
20
21 all:
22
23 install:
24         @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
25         @for i in $(APPS) ; \
26         do  \
27         (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
28         chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
29         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \
30         done;
31         @for i in $(MISC_APPS) ; \
32         do  \
33         (cp $$i $(INSTALL_PREFIX)$(OPENSSLDIR)/misc/$$i.new; \
34         chmod 755 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc/$$i.new; \
35         mv -f $(INSTALL_PREFIX)$(OPENSSLDIR)/misc/$$i.new $(INSTALL_PREFIX)$(OPENSSLDIR)/misc/$$i ); \
36         done;
37
38 files:
39         $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
40
41 links:
42
43 lint:
44
45 tags:
46
47 errors:
48
49 depend:
50
51 dclean:
52         $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
53         mv -f Makefile.new $(MAKEFILE)
54
55 clean:
56         rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
57
58 errors:
59
60 # DO NOT DELETE THIS LINE -- make depend depends on it.