-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (40 loc) · 1.75 KB
/
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
CC=gcc
ZIGCC=zig cc
CFLAGS="-Wall"
LIN=-target x86_64-linux
WIN=-target x86_64-windows
DST=build/bin
SRC=src/rep
g-unescape:clean-lin-unescape
$(CC) $(CFLAGS) -o $(DST)/unescape $(SRC)/unescape_standalone.c $(SRC)/escape.c $(SRC)/about.c $(SRC)/parser.c $(SRC)/pipe.c $(SRC)/tools.c $(SRC)/envvar.c
g-rep:clean-lin-rep
$(CC) $(CFLAGS) -o $(DST)/rep $(SRC)/main.c $(SRC)/about.c $(SRC)/escape.c $(SRC)/info.c $(SRC)/parser.c $(SRC)/pipe.c $(SRC)/tools.c $(SRC)/envvar.c
z-rep-lin-x64:clean-lin-rep
$(ZIGCC) $(LIN) $(CFLAGS) -o $(DST)/rep $(SRC)/main.c $(SRC)/about.c $(SRC)/escape.c $(SRC)/info.c $(SRC)/parser.c $(SRC)/pipe.c $(SRC)/tools.c $(SRC)/envvar.c
z-unescape-lin-x64:clean-lin-unescape
$(ZIGCC) $(LIN) $(CFLAGS) -o $(DST)/unescape $(SRC)/escape.c $(SRC)/about.c $(SRC)/info.c $(SRC)/parser.c $(SRC)/pipe.c $(SRC)/tools.c $(SRC)/envvar.c
z-win-x64:clean-win-rep
$(ZIGCC) $(WIN) $(CFLAGS) -g -o $(DST)/rep.exe $(SRC)/main.c $(SRC)/about.c $(SRC)/escape.c $(SRC)/info.c $(SRC)/parser.c $(SRC)/pipe.c $(SRC)/tools.c $(SRC)/envvar.c
debug:clean-lin
$(CC) $(CFLAGS) -g -o $(DST)/rep $(SRC)/main.c $(SRC)/about.c $(SRC)/escape.c $(SRC)/parser.c $(SRC)/pipe.c $(SRC)/tools.c $(SRC)/envvar.c
clean-lin-rep:
rm -vfr *~ build/bin/rep
clean-lin-unescape:
rm -vfr *~ build/bin/unescape
clean-lin:clean-lin-unescape clean-lin-rep
clean-win-rep:
rm -vfr *~ build/bin/rep.exe
rm -vfr *~ build/bin/rep.pdp
z-lin-x64:clean-lin z-unescape-lin-x64 z-rep-lin-x64
g-lin-x64:clean-lin g-unescape g-rep
stable:g-lin-x64
ztable:z-lin-x64
winx64:z-win-x64
linx64:ztable
install:
install build/bin/rep /usr/bin/rep
install build/bin/rep /usr/bin/unescape
list-variables:
printf '%s\n' $(.VARIABLES)
list-env:
@$(foreach V, $(.VARIABLES), $(info $(V) = $($(V))))