-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (29 loc) · 692 Bytes
/
Copy pathMakefile
File metadata and controls
39 lines (29 loc) · 692 Bytes
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
TARGET_PREFIX=
CC := $(TARGET_PREFIX)gcc
AS := $(TARGET_PREFIX)as
LD := $(TARGET_PREFIX)ld
NM := $(TARGET_PREFIX)nm
OBJDUMP := $(TARGET_PREFIX)objdump
OBJCOPY := $(TARGET_PREFIX)objcopy
SIZE := $(TARGET_PREFIX)size
TOP=$(shell pwd)
TARGET=run.elf
C_SOURCE_FILES += main.c \
OBJ=$(C_SOURCE_FILES:.c=.o)
INC_PATHS +=.
CFLAGS = -c
#CFLAGS += -Wall
#CFLAGS += -Wextra
CFLAGS += -ggdb
CFLAGS += $(addprefix -I, $(INC_PATHS))
LDFLAGS+= -lm
all: clean $(TARGET)
%.o:%.c
$(CC) $(CFLAGS) $< -o $@
$(TARGET): $(OBJ)
$(CC) $^ -o $@ $(LDFLAGS)
clean:
@find $(TOP) -type f -name "*.o" -delete
@rm -f $(TARGET)
@echo "cleaned."
.PHONY: clean