Take Grutatxt detection from MPDM's makefile.opts.
[mpsl.git] / makefile.in
blob2da6136a633450080304c765ca83e3500f311626
1 # -*- Mode: sh
3 LIB=libmpsl.a
5 all: $(TARGET) docs
7 PROJ=mpsl
8 DOCS=doc/mpsl_index.html doc/mpsl_overview.html doc/mpsl_internals.html \
9 doc/mpsl_quickref.ps doc/mpsl_api.html
11 OBJS=mpsl_c.o mpsl_l.o mpsl_m.o mpsl_y.o mpsl_f.o
13 DIST_TARGET=/tmp/$(PROJ)-$(VERSION)
15 ##################################################################
17 version:
18 @echo $(VERSION)
20 .c.o:
21 $(CC) $(CFLAGS) `cat config.cflags` -c $<
23 y.tab.h: mpsl.y
24 $(YACC) -d mpsl.y
26 y.tab.c: mpsl.y
27 $(YACC) -d mpsl.y
29 lex.yy.c: mpsl.l
30 flex mpsl.l
32 mpsl_l.o: lex.yy.c y.tab.h
33 $(CC) $(CFLAGS) `cat config.cflags` -c lex.yy.c -o mpsl_l.o
35 mpsl_y.o: y.tab.c
36 $(CC) $(CFLAGS) `cat config.cflags` -c y.tab.c -o mpsl_y.o
38 $(MPDM)/libmpdm.a:
39 ( cd $(MPDM); $(MAKE) )
41 dep:
42 gcc `cat config.cflags` -MM *.c | \
43 sed -e 's;$(MPDM)/;$$(MPDM)/;g' > makefile.depend
45 $(LIB): $(OBJS)
46 $(AR) rv $(LIB) $(OBJS)
48 $(TARGET): $(LIB) $(MPDM)/libmpdm.a
49 $(CC) $(CFLAGS) -L. -lmpsl `cat config.ldflags` -o $@
51 stress: stress.c $(LIB) $(MPDM)/libmpdm.a
52 $(CC) $(CFLAGS) `cat config.cflags` stress.c \
53 -L. -lmpsl `cat config.ldflags` -o $@
55 clean:
56 rm -f $(TARGET) $(LIB) $(OBJS) *.o tags *.tar.gz stress
58 realclean: clean
59 rm -f y.tab.c y.tab.h lex.yy.c
61 distclean: clean y.tab.c y.tab.h lex.yy.c
62 rm -f config.h config.cflags config.ldflags makefile.opts .config.log Makefile
64 .SUFFIXES: .txt .html
66 .txt.html:
67 $(GRUTATXT) < $< > $@
69 doc/mpsl_quickref.ps: doc/mpsl_quickref.txt
70 -./mpsl scripts/mkquickref.mpsl < $< > $@
72 doc/mpsl_api.html: mpsl_*.c mpsl.y
73 mkdir -p doc
74 -mp_doccer mpsl_*.c mpsl.y -o doc/mpsl_api -f html1 \
75 -t "MPSL C API ($(VERSION))" \
76 -a 'Angel Ortega - angel@triptico.com'
78 docs: $(DOCS)
80 docsclean:
81 rm -f doc/*.html
83 distcopy: distclean
84 mkdir -p $(DIST_TARGET) ; \
85 tar cf - * | (cd $(DIST_TARGET) ; tar xf -)
87 dist: distcopy
88 (cd /tmp ; tar czf - $(PROJ)-$(VERSION)/* ) > $(PROJ)-$(VERSION).tar.gz ; \
89 rm -rf $(DIST_TARGET)
91 install: installdoc
92 install $(TARGET) $(PREFIX)/bin
94 installdoc:
95 -install -m 644 $(DOCS) $(DOCDIR)