-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
65 lines (49 loc) · 1.31 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
55
56
57
58
59
60
61
62
63
64
65
THIS_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
EVSET_DIR := ../evsets
UTILS_DIR := ../utils
##################
# Build directory
##################
OBJDIR = obj
LOGDIR = log
CFLAGS += -I./$(OBJDIR)
CFLAGS += -I$(EVSET_DIR)/$(OBJDIR)
CFLAGS += -I$(UTILS_DIR)/$(OBJDIR)
CFLAGS += -Wall -Wno-unused-variable
####################
# Files and folders
####################
SRCS_AMP = ampL1fy.c
OBJS_AMP = $(addprefix $(OBJDIR)/,$(patsubst %.c,%.o,$(SRCS_AMP)))
OBJS_EVS = $(addprefix $(EVSET_DIR)/$(OBJDIR)/,$(notdir $(patsubst %.c,%.o,$(shell find $(EVSET_DIR)/*.c $(EVSET_DIR)/list/*.c))))
OBJS_UTL = $(addprefix $(UTILS_DIR)/$(OBJDIR)/,$(notdir $(patsubst %.c,%.o,$(shell find $(UTILS_DIR)/*.c))))
##########
# Targets
##########
all: clean utils evsets amp
# Compiling targets
amp: $(OBJS_AMP) $(OBJS_EVS) $(OBJS_UTL)
$(CC) -o $@ $^ $(LDFLAGS) -lrt -lm
utils:
$(MAKE) -C $(UTILS_DIR)
evsets:
$(MAKE) -C $(EVSET_DIR) CONFIG_FILE=$(UTILS_DIR)/configuration.h
$(OBJDIR)/%.o: %.c | objdir
$(CC) $(CFLAGS) -c $< -o $@
objdir:
@mkdir -p $(OBJDIR)
@mkdir -p $(LOGDIR)
# Execution targets
run:
rm -rf $(LOGDIR)/*.log
@./amp
@make histo
histo:
@python3 histo.py
# Cleaning targets
clean:
rm -rf amp
rm -rf $(OBJDIR)
$(MAKE) clean -C $(EVSET_DIR)/
$(MAKE) clean -C $(UTILS_DIR)/
.PHONY: all clean