Fix doc directory permissions.
[mpsl.git] / makefile.in
blob2e3f73c10ef279360d099415c8673d50c3b44b9f
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.html
13 OBJS=mpsl_c.o mpsl_l.o mpsl_m.o mpsl_y.o mpsl_f.o
15 DIST_TARGET=/tmp/$(PROJ)-$(VERSION)
17 ##################################################################
19 version:
20 @echo $(VERSION)
22 .c.o:
23 $(CC) $(CFLAGS) `cat config.cflags` -c $<
25 y.tab.h: mpsl.y
26 $(YACC) -d mpsl.y
28 y.tab.c: mpsl.y
29 $(YACC) -d mpsl.y
31 lex.yy.c: mpsl.l
32 flex mpsl.l
34 mpsl_l.o: lex.yy.c y.tab.h
35 $(CC) $(CFLAGS) `cat config.cflags` -c lex.yy.c -o mpsl_l.o
37 mpsl_y.o: y.tab.c
38 $(CC) $(CFLAGS) `cat config.cflags` -c y.tab.c -o mpsl_y.o
40 $(MPDM)/libmpdm.a:
41 ( cd $(MPDM); $(MAKE) )
43 dep:
44 gcc `cat config.cflags` -MM *.c | \
45 sed -e 's;$(MPDM)/;$$(MPDM)/;g' > makefile.depend
47 $(LIB): $(OBJS)
48 $(AR) rv $(LIB) $(OBJS)
50 $(TARGET): $(LIB) $(MPDM)/libmpdm.a
51 $(CC) $(CFLAGS) -L. -lmpsl `cat config.ldflags` -o $@
53 stress: stress.c $(LIB) $(MPDM)/libmpdm.a
54 $(CC) $(CFLAGS) `cat config.cflags` stress.c \
55 -L. -lmpsl `cat config.ldflags` -o $@
57 clean:
58 rm -f $(TARGET) $(LIB) $(OBJS) *.o tags *.tar.gz stress
60 realclean: clean
61 rm -f y.tab.c y.tab.h lex.yy.c
63 distclean: clean y.tab.c y.tab.h lex.yy.c
64 rm -f config.h config.cflags config.ldflags makefile.opts .config.log Makefile
66 realclean: distclean docsclean
68 realdistclean: realclean
70 .SUFFIXES: .txt .html
72 .txt.html:
73 grutatxt < $< > $@
75 doc/mpsl_quickref.ps: doc/mpsl_quickref.txt
76 -./mpsl scripts/mkquickref.mpsl < $< > $@
78 doc/mpsl_api.html: mpsl_*.c mpsl.y
79 mkdir -p doc
80 mp_doccer mpsl_*.c mpsl.y -o doc/mpsl_api -f html1 \
81 -t "MPSL C API ($(VERSION))" \
82 -a 'Angel Ortega - angel@triptico.com'
84 docs: $(DOCS)
86 docsclean:
87 rm -f doc/*.html
89 distcopy: distclean
90 mkdir -p $(DIST_TARGET) ; \
91 tar cf - * | (cd $(DIST_TARGET) ; tar xf -)
93 dist: distcopy
94 (cd /tmp ; tar czf - $(PROJ)-$(VERSION)/* ) > $(PROJ)-$(VERSION).tar.gz ; \
95 rm -rf $(DIST_TARGET)
97 install: installdoc
98 install $(TARGET) $(PREFIX)/bin
100 installdoc:
101 install doc/ -d $(DOCDIR)/
102 for f in README AUTHORS COPYING TODO RELEASE_NOTES ; do \
103 [ -f $$f ] && install -m 644 $$f $(DOCDIR)/$$f.$(PROJ) ; \
104 done