Updated makefile.in.
[mpsl.git] / makefile.in
blob830456683f2768ae38e2dbcbca2d225b84e061c1
1 # -*- Mode: sh
3 LIB=libmpsl.a
5 all: $(TARGET) docs
7 PROJ=mpsl
9 ADD_DOCS=doc/mpsl_quickref.ps
10 GRUTATXT_DOCS=doc/mpsl_index.html doc/mpsl_overview.html doc/mpsl_internals.html
11 MP_DOCCER_DOCS=doc/mpsl_api.txt doc/mpsl_reference.txt
12 G_AND_MP_DOCS=doc/mpsl_api.html doc/mpsl_reference.html
14 OBJS=mpsl_c.o mpsl_l.o mpsl_m.o mpsl_y.o mpsl_f.o mpsl_d.o
16 DIST_TARGET=/tmp/$(PROJ)-$(VERSION)
18 ##################################################################
20 version:
21 @echo $(VERSION)
23 .c.o:
24 $(CC) $(CFLAGS) `cat config.cflags` -c $<
26 y.tab.h: $(MPDM)/mpdm.h mpsl.y
27 $(YACC) -d mpsl.y
29 y.tab.c: $(MPDM)/mpdm.h mpsl.y
30 $(YACC) -d mpsl.y
32 lex.yy.c: $(MPDM)/mpdm.h mpsl.l
33 flex mpsl.l
35 mpsl_l.o: lex.yy.c y.tab.h
36 $(CC) $(CFLAGS) `cat config.cflags` -c lex.yy.c -o mpsl_l.o
38 mpsl_y.o: y.tab.c
39 $(CC) $(CFLAGS) `cat config.cflags` -c y.tab.c -o mpsl_y.o
41 $(MPDM)/libmpdm.a:
42 ( cd $(MPDM); $(MAKE) )
44 dep:
45 gcc `cat config.cflags` -MM *.c | \
46 sed -e 's;$(MPDM)/;$$(MPDM)/;g' > makefile.depend
48 $(LIB): $(OBJS)
49 $(AR) rv $(LIB) $(OBJS)
51 $(TARGET): $(LIB) $(MPDM)/libmpdm.a
52 $(CC) $(CFLAGS) -L. -lmpsl `cat config.ldflags` -o $@
54 stress: stress.c $(LIB) $(MPDM)/libmpdm.a
55 $(CC) $(CFLAGS) `cat config.cflags` stress.c \
56 -L. -lmpsl `cat config.ldflags` -o $@
58 clean:
59 rm -f $(TARGET) $(LIB) $(OBJS) *.o tags *.tar.gz stress
61 realclean: clean
62 rm -f y.tab.c y.tab.h lex.yy.c
64 distclean: clean y.tab.c y.tab.h lex.yy.c
65 rm -f config.h config.cflags config.ldflags makefile.opts .config.log Makefile
67 realclean: distclean docsclean
69 realdistclean: realclean
71 .SUFFIXES: .txt .html
73 .txt.html:
74 grutatxt < $< > $@
76 doc/mpsl_quickref.ps: doc/mpsl_quickref.txt
77 -./mpsl scripts/mkquickref.mpsl < $< > $@
79 doc/mpsl_api.txt: mpsl_c.c mpsl.y
80 mp_doccer mpsl_c.c mpsl.y -o doc/mpsl_api -f grutatxt \
81 -t "MPSL C API" \
82 -b "This reference documents version $(VERSION) of the C API." \
83 -a 'Angel Ortega - angel@triptico.com'
85 doc/mpsl_reference.txt: mpsl_f.c
86 mp_doccer mpsl_f.c -o doc/mpsl_reference -f grutatxt \
87 -t "MPSL Function Library Reference" \
88 -b "This reference documents version $(VERSION) of the MPSL Function Library." \
89 -a 'Angel Ortega - angel@triptico.com'
91 docs: $(DOCS)
93 docsclean:
94 rm -f $(MP_DOCCER_DOCS) doc/*.html
96 distcopy: distclean
97 mkdir -p $(DIST_TARGET) ; \
98 tar cf - * | (cd $(DIST_TARGET) ; tar xf -)
100 dist: distcopy
101 (cd /tmp ; tar czf - $(PROJ)-$(VERSION)/* ) > $(PROJ)-$(VERSION).tar.gz ; \
102 rm -rf $(DIST_TARGET)
104 install: installdoc
105 install $(TARGET) $(PREFIX)/bin
107 installdoc:
108 install -d $(DOCDIR)
109 install -m 644 doc/* $(DOCDIR)/
110 for f in README AUTHORS COPYING TODO RELEASE_NOTES ; do \
111 [ -f $$f ] && install -m 644 $$f $(DOCDIR)/$$f.$(PROJ) ; \
112 done