-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (27 loc) · 799 Bytes
/
Makefile
File metadata and controls
35 lines (27 loc) · 799 Bytes
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
.PHONY: clean install
VERSION = 0.1
# You may remove `NEED_STRL' from CFLAGS
# and `strl.o' from OBJ if your system
# provides strlcpy and strlcat.
CC = cc
PREFIX = /usr/local/bin
CFLAGS = -std=c99 -pedantic -Wall -D_DEFAULT_SOURCE -D_BSD_SOURCE \
-DVERSION=\"${VERSION}\" -DNEED_STRL
SHELL_TARGETS = bash ksh zsh rc
OBJ = segment.o main.o pwd.o git.o strl.o
HDR = pwrln.h segments.h config.h
pwrln: ${OBJ}
@echo LD $@
@${CC} -o $@ ${OBJ}
.c.o: ${HDR}
@echo CC $<
@${CC} -c ${CFLAGS} $<
clean:
rm ${OBJ}
install: pwrln
@echo Installing to ${PREFIX}/pwrln
@cp ./pwrln ${PREFIX}/pwrln
@SH_TG="${SHELL_TARGETS}" && for s in $$SH_TG; \
do ln -s pwrln ${PREFIX}/pwrln-$$s 2> /dev/null && \
echo Added symlink ${PREFIX}/pwrln-$$s || \
echo ${PREFIX}/pwrln-$$s already exists; done