-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
40 lines (30 loc) · 820 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
PREFIX = /usr
INCS = -I. -I/usr/include
LIBS = -L/usr/lib -lc -lsocket
CC = cc
CPPFLAGS = -D_POSIX_C_SOURCE=200809L
CFLAGS += -pedantic -Wall ${INCS} ${CPPFLAGS}
LDFLAGS = -s ${LIBS}
SRC = jjd.c
OBJS = ${SRC:.c=.o}
all: jjd
%.o: %.c
@echo CC $<
$(CC) -c $(CFLAGS) $<
jjd: $(OBJS)
@echo CC -o $@
$(CC) -o $@ $(OBJS) $(LDFLAGS)
clean:
@echo cleaning
rm -f *.o jjd
install: all
@echo installing executable files to ${DESTDIR}${PREFIX}/bin
@install -Dm 755 jjd ${DESTDIR}${PREFIX}/bin/jjd
@install -Dm 755 jjc ${DESTDIR}${PREFIX}/bin/jjc
@install -Dm 755 jjp ${DESTDIR}${PREFIX}/bin/jjp
uninstall:
@echo removing executable files from ${DESTDIR}${PREFIX}/bin
@rm -f ${DESTDIR}${PREFIX}/bin/jjd
@rm -f ${DESTDIR}${PREFIX}/bin/jjc
@rm -f ${DESTDIR}${PREFIX}/bin/jjp
.PHONY: all clean install uninstall