aboutsummaryrefslogtreecommitdiff
path: root/decomp/Makefile
blob: da0acf0c483ae48f5ce816815e0fa5266d0c1730 (plain) (blame)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Makefile for decomp - a decompiler
#
# Copyright (C) 2001 Jonathan duSaint <dusaint@earthlink.net>

SHELL = /bin/bash
CC = gcc
CFLAGS = -g -Wall -O2

CORESOURCE = decomp.c data.c code.c fileinfo.c symtab.c memory.c hash.c error.c
FILESOURCE = elf.c dos.c
ARCHSOURCE = ia32.c alpha.c
SOURCES = $(CORESOURCE) $(FILESOURCE) $(ARCHSOURCE)

EXE = decomp

DOCSOURCE = decomp.texinfo
TEXI2DVI = texi2dvi
DVIPS = dvips
TEXI2HTML = texi2html -monolithic
DOCEXTRAS = *.aux *.cp *.dvi *.fn *.ky *.log *.pg *.toc *.tp *.vr *.ps
MEMTESTFILES = memtest.c memory.c error.c
HASHTESTFILES = hashtest.c hash.c error.c


.PHONY : all dist clean doc ps info html install installdoc help test

all : $(EXE)

dist : clean
	(cd ..; tar -c decomp | gzip -c > decomp-0.0.tar.gz)

help :
	@echo Valid targets are
	@echo - all:         make the executable file
	@echo - install:     install the executable file
	@echo - clean:       remove any generated files
	@echo - doc:         create all of the documentation
	@echo - ps:          create the Postscript documentation
	@echo - html:        create the HTML documentation
	@echo - info:        create the Texinfo documentation
	@echo - installdoc:  install the HTML and Texinfo documentation
	@echo - help:        print this message
	@echo - test:        run the testsuite


$(EXE) : $(SOURCES:.c=.o)

doc : ps info html

ps : $(DOCSOURCE:.texinfo=.ps)

$(DOCSOURCE:.texinfo=.ps) : $(DOCSOURCE:.texinfo=.dvi)
	$(DVIPS) -o $@ $<

$(DOCSOURCE:.texinfo=.dvi) : $(DOCSOURCE)
	$(TEXI2DVI) $<

info : $(DOCSOURCE:.texinfo=.info)

$(DOCSOURCE:.texinfo=.info) : $(DOCSOURCE)
	$(MAKEINFO) $<

html : $(DOCSOURCE:.texinfo=.html)

$(DOCSOURCE:.texinfo=.html) : $(DOCSOURCE)
	$(TEXI2HTML) $<

install : $(EXE)
	@echo Not much here yet...
installdoc : info html
	@echo Not much here yet...

clean :
	rm -f *.o *~ $(EXE) memtest hashtest *.info *.html $(DOCEXTRAS)

test :
	touch test/.runtest
	make -C test

memtest : $(MEMTESTFILES:.c=.o)

hashtest : LDFLAGS = -lreadline -lhistory -ltermcap
hashtest : $(HASHTESTFILES:.c=.o)