-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile_c
executable file
·54 lines (47 loc) · 1.46 KB
/
Makefile_c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
###############################################################################
# Makefile for literate programes. It creates pdf and dvi documents as
# well as generate codes for execution.
#
# USAGE :
# $ make -- To execute the program.
# $ make dvi -- To make a dvi document.
# $ make pdf -- To create a pdf document.
# $ make showdvi
# $ make showpdf
#
# (c) Dilawar, 2011
# Email : dilawar@ee.iitb.ac.in
#
# June 30, 2011
###############################################################################
SHELL = /bin/sh
NOTANGLE = notangle
NOWEAVE = noweave #-delay it implies -n option. Automatic latex wrapper will not be includeded in out tex file.
CC = gcc
CFLAGS = -Wall -D DEBUG -L /ur/lib
file = demo_bdd
LDFLAGS = -lgb
$(file) : $(file).snw
$(NOTANGLE) -RHeader $< | cpif ./codes/$(file).h
$(NOTANGLE) $< | cpif ./codes/$(file).c
$(CC) $(CFLAGS) ./codes/$(file).c -o mybdd $(LDFLAGS)
dvi : $(file).snw
$(NOWEAVE) $< > ./docs/$(file).tex
latex -output-directory=docs ./docs/$(file).tex
rm -rf *.log *.aux *.tex~
pdf : $(file).snw
$(NOWEAVE) $< > ./docs/$(file).tex
pdflatex -output-directory=docs ./docs/$(file).tex
rm -rf *.log *.aux *.tex~
showdvi :
if $(shell test -e ./docs/$(file).dvi) \
then $(shell xdvi ./docs/$(file).dvi) \
else echo 'Run make dvi file=filename.' ;\
fi
showpdf :
if $(shell test -e ./docs/$(file).pdf)\
then $(shell xpdf ./docs/$(file).pdf) \
else echo 'Run make pdf file=filename.' ;\
fi
purge :
rm -rf ./docs/* ./codes/*