-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (39 loc) · 1.18 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
# **********************************************************************
# @copyright : Siemens AG
# @license : GPLv3
# @author : Andreas Kaeberlein
# @address : Clemens-Winkler-Strasse 3, 09116 Chemnitz
#
# @maintainer : Andreas Kaeberlein
# @telephone : +49 371 4810-2108
# @email : [email protected]
#
# @file : Makefile
# @date : 2017-01-30
#
# @brief : Build
# builds sources with all dependencies
# **********************************************************************
# select compiler
CC = gcc
# set linker
LINKER = gcc
# set compiler flags
ifeq ($(origin CFLAGS), undefined)
CFLAGS = -c -O -Wall -Wextra -Wimplicit -Wconversion -I .
endif
# linking flags here
ifeq ($(origin LFLAGS), undefined)
LFLAGS = -Wall -Wextra -I. -lm
endif
all: pciinfo
pciinfo: pciinfo_main.o pciinfo.o
$(LINKER) ./bin/pciinfo_main.o ./bin/pciinfo.o $(LFLAGS) -o ./bin/pciinfo
pciinfo_main.o: ./pciinfo_main.c
$(CC) $(CFLAGS) ./pciinfo_main.c -o ./bin/pciinfo_main.o
pciinfo.o: ./pciinfo.c
$(CC) $(CFLAGS) ./pciinfo.c -o ./bin/pciinfo.o
ci: ./pciinfo.c
$(CC) $(CFLAGS) -Werror -DPCIINFO_PRINTF_EN ./pciinfo.c -o ./bin/pciinfo.o
clean:
rm -f ./bin/*.o ./bin/pciinfo