-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (39 loc) · 1.28 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
###########################################################################
#
# Filename: Makefile
#
# Author: Marcelo Mourier
# Created: Sun, Mar 14, 2021 10:10:04 PM
#
# Description: This makefile is used to build the actFileTool
#
#
#
###########################################################################
#
# Copyright (c) 2021 Marcelo Mourier
#
###########################################################################
BIN_DIR = .
DEP_DIR = .
OBJ_DIR = .
CFLAGS = -m64 -D_GNU_SOURCE -I. -I./fit -ggdb -Wall -Werror -O0
LDFLAGS = -ggdb
SOURCES = $(wildcard *.c)
OBJECTS := $(patsubst %.c,$(OBJ_DIR)/%.o,$(SOURCES))
DEPS := $(patsubst %.c,$(DEP_DIR)/%.d,$(SOURCES))
# Rule to autogenerate dependencies files
$(DEP_DIR)/%.d: %.c
@set -e; $(RM) $@; \
$(CC) -MM $(CPPFLAGS) $< > [email protected]; \
sed 's,\($*\)\.o[ :]*,$(OBJ_DIR)\/\1.o $@ : ,g' < [email protected] > $@; \
$(RM) [email protected]
# Rule to generate object files
$(OBJ_DIR)/%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<
all: actFileTool
actFileTool: $(OBJECTS) Makefile
$(CC) $(LDFLAGS) -o $(BIN_DIR)/$@ $(OBJECTS) -lm
clean:
$(RM) $(OBJECTS) $(OBJ_DIR)/build_info.o $(DEP_DIR)/*.d $(BIN_DIR)/actFileTool
include $(DEPS)