-
Notifications
You must be signed in to change notification settings - Fork 36
/
Makefile
54 lines (43 loc) · 1.02 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
# Makefile
#
# 03/12/2021 Léo Dumez ([email protected])
#
# Generic makefile (Yocto Compliant)
#
# 5/3/2012 D. W. Hawkins ([email protected])
#
# Create the Linux pci_debug utility for accessing
# BAR regions.
#
APP_NAME=pci_debug
SRC_DIR=.
OBJS_DIR=obj
BIN_DIR=bin
CFLAGS=
LIBS=-lreadline
EXEC=$(BIN_DIR)/$(APP_NAME)
SRC := $(wildcard $(SRC_DIR)/*.c)
OBJS=$(SRC:$(SRC_DIR)/%.c=$(OBJS_DIR)/%.o)
MKDIR_P=mkdir -p
RM_RF=rm -rf
all: $(EXEC)
$(EXEC): $(OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Cross GCC Linker'
$(MKDIR_P) $(BIN_DIR)
$(CC) -o "$@" $(OBJS) $(LDFLAGS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
$(OBJS_DIR)/%.o: $(SRC_DIR)/%.c
@echo 'Building file: $<'
@echo 'Invoking: Cross GCC Compiler'
$(MKDIR_P) $(OBJS_DIR)
$(CC) -O0 -g3 -Wall -c -fmessage-length=0 -o "$@" "$<" $(CFLAGS)
@echo 'Finished building: $<'
@echo ' '
clean:
$(RM_RF) obj *~ core .depend .*.cmd *.ko *.mod.c
$(RM_RF) Module.markers modules.order
$(RM_RF) .tmp_versions
$(RM_RF) Modules.symvers
$(RM_RF) bin