-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (36 loc) · 767 Bytes
/
Makefile
File metadata and controls
48 lines (36 loc) · 767 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
36
37
38
39
40
41
42
43
44
45
46
47
48
# Ters Makefile
# By Mohammad Amin Mollazadeh
# C Compiler
CC = gcc
# Linker
LD = gcc
# Compiler Arguments
CFLAGS =
# Linker Arguments
LDFLAGS =
# Install root
DESTDIR = /
# Install prefix
PREFIX = usr
# libraries to be linked
LIBRARIES = util ncurses event_core
SRC = $(wildcard src/*.c)
OBJ = $(patsubst src/%.c, build/obj/%.o, $(SRC))
LDFLAGS2 = $(patsubst %, -l%, $(LIBRARIES)) $(LDFLAGS)
all: build/ters
# link
build/ters: $(OBJ)
$(LD) -o $@ $(OBJ) $(LDFLAGS2)
# compile
build/obj/%.o: src/%.c
$(CC) -g -c $< -o $@
run: build/ters
build/ters
clean:
rm -rf build/ters $(OBJ)
install: ters
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f ters $(DESTDIR)$(PREFIX)/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/ters
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/ters