-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (34 loc) · 1002 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
41
42
43
44
#########################
SOURCES := cmdline.c BVTserialInterfacer.c serial_jjm.c convenient_wrapper_functions.c
PROG := BVTserialInterfacer
CFLAGS := -Wall -Wextra -std=gnu99
LDFLAGS := -lserialport
#For install
ifeq ($(PREFIX),)
PREFIX := /usr/local
endif
########################
# -MMD generates dependencies while compiling
CFLAGS += -MMD
CC := gcc
#for release
release: $(PROG)
release: CFLAGS += -O3
OBJFILES := $(SOURCES:.c=.o)
DEPFILES := $(SOURCES:.c=.d)
$(PROG) : $(OBJFILES)
$(LINK.o) $(LDFLAGS) -o $@ $^
builddebug: cmdline #Assuming that the debug request means that the person is a developer,
builddebug: debug
#For debug
debug: CFLAGS += -DDEBUG -g -O2
#and therefore wants to re-generate the command line options from the GNU gengetopts script.
debug: $(PROG)
cmdline:
gengetopt < $(srcdir)genOptions.ggo
clean :
rm -f $(PROG) $(OBJFILES) $(DEPFILES)
install :
install -d $(DESTDIR)$(PREFIX)/bin
install $(PROG) $(DESTDIR)$(PREFIX)/bin/
-include $(DEPFILES)