Version 1.0.11 RELEASED.
[ahxm.git] / makefile.in
blob904b7fb949774de3c0235398d19f6c7e8fa65ba0
1 # -*- Mode: sh
3 PROJ=ahxm
4 APPNAME=ahxm
5 LIB=lib$(PROJ).a
6 BIN=ahxm midiin
8 OBJS=support.o sha1.o song.o compiler_l.o compiler_y.o \
9 ss_core.o ss_input.o ss_gen.o ss_eff.o ss_ins.o ss_song.o \
10 ss_output.o ss_outdev.o midi_song.o main.o
12 ADD_DOCS=RELEASE_NOTES TODO README
13 GRUTATXT_DOCS=doc/ahs_overview_i.html \
14 doc/ahs_overview_ii.html \
15 doc/ahs_appendix_1.html \
16 doc/ahxm_index.html
17 MP_DOCCER_DOCS=doc/ahxm_api.html
19 all: $(BIN) $(DOCS)
21 DIST_TARGET=/tmp/$(PROJ)-$(VERSION)
23 ##################################################################
25 version:
26 @echo $(VERSION)
28 .c.o:
29 $(CC) $(CFLAGS) `cat config.cflags` -c $<
31 y.tab.h: compiler.y
32 $(YACC) -d compiler.y
34 y.tab.c: compiler.y
35 $(YACC) -d compiler.y
37 lex.yy.c: compiler.l
38 flex compiler.l
40 compiler_l.o: lex.yy.c y.tab.h
41 $(CC) $(CFLAGS) -c lex.yy.c -o compiler_l.o
43 compiler_y.o: y.tab.c
44 $(CC) $(CFLAGS) -c y.tab.c -o compiler_y.o
46 # library
47 $(LIB): $(OBJS)
48 ar rv $(LIB) $(OBJS)
50 # binaries
51 ahxm: $(LIB)
52 $(CC) $(CFLAGS) $(LIB) -lm `cat config.ldflags` -o $@
54 wav: wav.c $(LIB)
55 $(CC) $(CFLAGS) wav.c $(LIB) -lm `cat config.ldflags` -o $@
57 midiin: midiin.c $(LIB)
58 $(CC) $(CFLAGS) midiin.c $(LIB) -lm `cat config.ldflags` -o $@
60 clean:
61 rm -f $(BIN) $(LIB) $(OBJS) *.o tags *.tar.gz
63 realclean: clean
64 rm -f y.tab.c y.tab.h lex.yy.c
66 distclean: realclean
67 rm -f config.h config.cflags config.ldflags makefile.opts .config.log Makefile
69 .SUFFIXES: .txt .html
71 .txt.html:
72 grutatxt < $< > $@
74 doc/ahxm_api.html: *.c
75 mp_doccer *.c -o doc/ahxm_api -f html1 \
76 -t "Ann Hell Ex Machina API ($(VERSION))" \
77 -a 'Angel Ortega - angel@triptico.com'
79 docsclean:
80 rm -f doc/*.html
82 distcopy: distclean docs y.tab.c y.tab.h lex.yy.c
83 mkdir -p $(DIST_TARGET) ; \
84 tar cf - * | (cd $(DIST_TARGET) ; tar xf -)
86 dist: distcopy
87 (cd /tmp ; tar czf - $(PROJ)-$(VERSION)/* ) > $(PROJ)-$(VERSION).tar.gz ; \
88 rm -rf $(DIST_TARGET)
90 dep:
91 gcc -MM *.c > makefile.depend
93 install:
94 install $(APPNAME) $(PREFIX)/bin
95 ./mkinstalldirs $(PREFIX)/share/doc/$(PROJ)
96 install -m 644 doc/* $(PREFIX)/share/doc/$(PROJ)
97 install -m 644 $(ADD_DOCS) $(PREFIX)/share/doc/$(PROJ)
99 test:
100 ./test.sh