-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (39 loc) · 866 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# MeowMeow - A stream encoder/decoder
ENCODER= moo
DECODER= unmoo
TARGETS= $(ENCODER) $(DECODER)
SRC= main.c mmencode.c mmdecode.c
OBJ= $(SRC:.c=.o)
HDR= $(SRC:.c=.h) table.h
MANIFEST= $(SRC) $(HDR) README.md Makefile
VERSION = 0.1.0
SDIST_ROOT= meowmeow
SDIST_TARFILE= $(SDIST_ROOT)-$(VERSION).tar.gz
CC= cc
CP= cp
DIFF= diff
LN= ln
MKDIR= mkdir
RM= rm
TAR= tar
CFLAGS= -g
LDFLAGS=
.PHONY: sdist
all: $(TARGETS)
$(ENCODER): $(OBJ)
$(CC) -o $@ $(OBJ) $(CFLAGS) $(LDFLAGS)
.c.o: $(HDR)
$(CC) -c $< $(CFLAGS)
$(DECODER): $(ENCODER)
$(LN) -f $< $@
sdist: clobber
$(MKDIR) -p $(SDIST_ROOT)
$(CP) $(MANIFEST) $(SDIST_ROOT)
$(TAR) zcf $(SDIST_TARFILE) $(SDIST_ROOT)
README.meow: $(ENCODER) README.md
./$(ENCODER) < README.md > $@
clean:
@$(RM) -f $(OBJ) *~ README.meow
clobber: clean
@$(RM) -f $(TARGETS) $(SDIST_TARFILE)
@$(RM) -rf $(SDIST_ROOT)