File: Makefile

package info (click to toggle)
hodie 1.4-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 144 kB
  • ctags: 104
  • sloc: ansic: 1,132; makefile: 75
file content (56 lines) | stat: -rw-r--r-- 1,235 bytes parent folder | download | duplicates (4)
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
# Change these to customize for your setup
CC=gcc
CFLAGS=-g -Wall

# Install paths and command on recommendation from Peter Pentchev
INSTALL=/usr/bin/install -c

# Some prefer /usr/local over /usr as installation root
#INSTALL_PATH=/usr/local
INSTALL_PATH=/usr

BINDIR=$(INSTALL_PATH)/bin
MAN1DIR=$(INSTALL_PATH)/man/man1

# BSD might prefer this
# DOCPATH=$(INSTALL_PATH)/share/doc/hodie

# Linux might prefer this:
DOCDIR=$(INSTALL_PATH)/doc/packages/hodie

#############################
# End of user configuration #
#############################

EXEC=hodie
OBJECTS=hodie.o version.o help.o isleap.o to_roman.o to_roman_numerals.o\
	 parse_date.o date_to_roman.o
HEADERS=hodie.h includes.h version.h to_roman.h
DOCS=README LICENSE BUGS CREDITS CHANGELOG TODO DISTRIBUTORS

all: $(EXEC)

.PHONY: clean install uninstall all

$(EXEC): $(OBJECTS)
	$(CC) $(CFLAGS) -o $(EXEC) $(OBJECTS)

.c.o:
	$(CC) -c $(CFLAGS) -o $@ $<

$(OBJECTS): $(HEADERS)

install: $(EXEC)
	$(INSTALL) -s -m 755 $(EXEC) $(BINDIR)
	install -m 644 hodie.1 $(MAN1DIR)
	install -d $(DOCDIR)
	install -m 644 $(DOCS) $(DOCDIR)

uninstall:
	-rm -f $(BINDIR)/$(EXEC)
	-rm -f $(MAN1DIR)/hodie.1
	cd $(DOCDIR) && rm -f $(DOCS)
	-rm -r $(DOCDIR)

clean:
	-rm $(EXEC) *.o