-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathMakefile.mk
40 lines (38 loc) · 873 Bytes
/
Makefile.mk
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
# do you want to show the commands executed ?
# Since we are using ?= for assignment it means that you can just
# set this from the command line and avoid changing the makefile...
DO_MKDBG?=0
# suffix for c++ source files
SUFFIX_CC:=cc
# suffix for c++ header files
SUFFIX_HH:=hh
# suffix for binary files
SUFFIX_BIN:=elf
# suffix for C and assembly object files
SUFFIX_O:=o
# suffix for c++ object files
SUFFIX_OO:=oo
# suffix for dependency files
SUFFIX_DEP:=dep
# suffix for library files
SUFFIX_LIB:=so
# compile with intel compiler?
DO_INTEL:=0
########
# code #
########
# silent stuff
ifeq ($(DO_MKDBG),1)
Q:=
# we are not silent in this branch
else # DO_MKDBG
Q:=@
#.SILENT:
endif # DO_MKDBG
##################
# patterns rules #
##################
# replace the regular %.c->%.o rule with a silent one
%.o: %.c
$(info doing [$@])
$(Q)gcc $(CFLAGS) -c -o $@ $<