-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (32 loc) · 832 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
45
46
CC = gcc
DEFS =
INCDIRS = -Isrc
LIBS =
OPT = -g
CCFLAGS = $(DEFS) $(OPT)
BUILD_DIR = build
TARGET = $(BUILD_DIR)/bus_generator
OBJ_DIR = $(BUILD_DIR)/obj
SRC := main.c arg_parser.c gen_axi_amba.c gen_axi_utils.c gen_axi_mtos.c
SRC += gen_axi_stom.c gen_axi_arbiter_mtos.c gen_axi_arbiter_stom.c
SRC += gen_axi_default_slave.c gen_axi_wid.c
OBJS = $(SRC:.c=.o)
H_DIR = src
C_DIR = src
vpath %.h $(H_DIR)
vpath %.c $(C_DIR)
$(OBJ_DIR)/%.o: %.c
$(CC) -c $(CCFLAGS) $(INCDIRS) -o $@ $<
prev-build:
@mkdir -p build
@mkdir -p build/obj
all: prev-build $(TARGET)
$(TARGET): $(addprefix $(OBJ_DIR)/, $(OBJS))
$(CC) -o $(TARGET) $^ $(LIBS)
simu:
make -C test/iverilog
DIRS = $(subst /,, $(dir $(wildcard */Makefile)))
clean:
rm -rf $(BUILD_DIR)
.PHONY:
prev-build all simu clean