forked from codythegreat/dss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (45 loc) · 1.03 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
51
52
53
54
55
56
57
58
59
SRCS = src/main.c src/parser.c src/display.c src/slides.c src/parsecommand.c src/mdlink.c
OBJS = $(SRCS:.c=.o)
PREFIX ?= /usr/local
INSTALL ?= install
INSTALL_PROGRAM ?= $(INSTALL)
ifneq "$(DESTDIR)" ""
PREFIX = $(DESTDIR)
endif
# Lets users pass custom options in
# without overwriting ours
CFLAGS ?=
CFLAGS += -Wall -Wextra
CPPFLAGS ?=
CPPFLAGS += -DPROGNAME=\"dss\"
LDFLAGS ?=
LDFLAGS += -lncursesw
ifneq "$(DEBUG)" ""
CFLAGS += -O0 -g -ggdb
CPPFLAGS += -DDSS_DEBUG=1
else
CFLAGS += -O2
endif
all: dss
# XXX only needed because of -I ./include:
# generally speaking, Make knows
# how to build C programs.
%.o: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c -I ./include $< -o $@
dss: $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o dss $(LDFLAGS)
tidy:
$(RM) *.o
$(RM) src/*.o
clean: tidy
$(RM) dss
install: dss
## TODO Determine what use the installation
## categories have.
#$(PRE_INSTALL)
$(INSTALL_PROGRAM) -d $(PREFIX)/bin
#$(NORMAL_INSTALL)
$(INSTALL_PROGRAM) -m755 dss $(PREFIX)/bin
uninstall:
#$(NORMAL_UNINSTALL)
$(RM) $(PREFIX)/bin/dss