Fool-proofing Makefiles
[openssl.git] / crypto / objects / Makefile
1 #
2 # SSLeay/crypto/objects/Makefile
3 #
4
5 DIR=    objects
6 TOP=    ../..
7 CC=     cc
8 INCLUDES= -I.. -I$(TOP) -I../../include
9 CFLAG=-g
10 MAKEDEPPROG=    makedepend
11 MAKEDEPEND=     $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
12 MAKEFILE=       Makefile
13 AR=             ar r
14 PERL=           perl
15
16 CFLAGS= $(INCLUDES) $(CFLAG)
17
18 GENERAL=Makefile README
19 TEST=
20 APPS=
21
22 LIB=$(TOP)/libcrypto.a
23 LIBSRC= o_names.c obj_dat.c obj_lib.c obj_err.c
24 LIBOBJ= o_names.o obj_dat.o obj_lib.o obj_err.o
25
26 SRC= $(LIBSRC)
27
28 EXHEADER= objects.h obj_mac.h
29 HEADER= $(EXHEADER) obj_dat.h
30
31 ALL=    $(GENERAL) $(SRC) $(HEADER)
32
33 top:
34         (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
35
36 all:    obj_dat.h lib
37
38 lib:    $(LIBOBJ)
39         $(AR) $(LIB) $(LIBOBJ)
40         $(RANLIB) $(LIB) || echo Never mind.
41         @touch lib
42
43 obj_dat.h: obj_dat.pl obj_mac.h
44         $(PERL) obj_dat.pl obj_mac.h obj_dat.h
45
46 # objects.pl both reads and writes obj_mac.num
47 obj_mac.h: objects.pl objects.txt obj_mac.num
48         $(PERL) objects.pl objects.txt obj_mac.num obj_mac.h
49         @sleep 1; touch obj_mac.h; sleep 1
50
51 files:
52         $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
53
54 links:
55         @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
56         @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
57         @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
58
59 install:
60         @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
61         @headerlist="$(EXHEADER)"; for i in $$headerlist ; \
62         do  \
63         (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
64         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
65         done;
66
67 tags:
68         ctags $(SRC)
69
70 tests:
71
72 lint:
73         lint -DLINT $(INCLUDES) $(SRC)>fluff
74
75 depend:
76         $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
77
78 dclean:
79         $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
80         mv -f Makefile.new $(MAKEFILE)
81
82 clean:
83         rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
84
85 # DO NOT DELETE THIS LINE -- make depend depends on it.
86
87 o_names.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
88 o_names.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
89 o_names.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
90 o_names.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
91 o_names.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
92 o_names.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
93 o_names.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
94 o_names.o: o_names.c
95 obj_dat.o: ../../e_os.h ../../include/openssl/asn1.h
96 obj_dat.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
97 obj_dat.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
98 obj_dat.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
99 obj_dat.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
100 obj_dat.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
101 obj_dat.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
102 obj_dat.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
103 obj_dat.o: ../cryptlib.h obj_dat.c obj_dat.h
104 obj_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
105 obj_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
106 obj_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
107 obj_err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
108 obj_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
109 obj_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
110 obj_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
111 obj_err.o: obj_err.c
112 obj_lib.o: ../../e_os.h ../../include/openssl/asn1.h
113 obj_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
114 obj_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
115 obj_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
116 obj_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
117 obj_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
118 obj_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
119 obj_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
120 obj_lib.o: ../cryptlib.h obj_lib.c