-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (33 loc) · 981 Bytes
/
Makefile
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
# just -lcurses for SYS V
LIBS = -lncurses
# add -DBSD42 for performance wins on 4.2 or better
IFDEF = -DBSD42
CFLAGS = $(IFDEF) -O2 -Wall -Wextra #-g
LINT = lint
LLFLAGS = -haxbc
SHAR = shar
SHFLGS = -v -c
HEADERS = robots.h
SRC = good.c main.c opt.c robot.c score.c user.c
OBJS = good.o main.o opt.o robot.o score.o user.o
MAN = robots.6
MISC = README Makefile
DIST = $(MISC) $(SRC) $(MAN) $(HEADERS)
MANUAL = /usr/share/man/man6/robots.6 # where the manual page goes
BINARY = /usr/games # Where the binary goes
robots: ${OBJS}
$(CC) $(CFLAGS) -o $@ ${OBJS} $(LIBS)
install: robots robots.6
install -s robots $(BINARY) # or strip robots && mv robots $(BINARY)
# install -c robots.6 $(MANUAL) # or cp robots.6 $(MANUAL)
tidy: clean
clean:
rm -f ${OBJS} core a.out lint.out shar.out
clobber: clean
rm -f robots
lint: ${SRC} $(HEADERS)
$(LINT) $(LLFLAGS) $(IFDEF) ${SRC} $(LIBS)
shar: shar.out
shar.out: $(DIST)
$(SHAR) $(SHFLGS) $(DIST) > $@
${OBJS}: ${HEADERS}