parent
d956c88156
commit
7d7b49a668
1 changed files with 4 additions and 3 deletions
7
Makefile
7
Makefile
|
@ -1,10 +1,11 @@
|
||||||
# Compiler to use
|
# Compiler to use
|
||||||
CC ?= gcc
|
CC ?= gcc
|
||||||
|
|
||||||
CFLAGS = -Wall -Wextra -std=gnu17 -I include -lelf
|
CFLAGS = -Wall -Wextra -std=gnu17 -I include
|
||||||
|
LDFLAGS = -lelf
|
||||||
|
|
||||||
# Directory for build outputs
|
# Directory for build outputs
|
||||||
BUILD_DIR := build-$(uname -i)
|
BUILD_DIR := build
|
||||||
|
|
||||||
# Name of the output program
|
# Name of the output program
|
||||||
PROGRAM_NAME ?= criscv
|
PROGRAM_NAME ?= criscv
|
||||||
|
@ -32,7 +33,7 @@ debug: $(TARGET)
|
||||||
|
|
||||||
# Rule to link object files into the final executable
|
# Rule to link object files into the final executable
|
||||||
$(TARGET): $(OBJS) | $(BUILD_DIR)
|
$(TARGET): $(OBJS) | $(BUILD_DIR)
|
||||||
$(CC) $(CFLAGS) $^ -o $@
|
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
|
||||||
du -b $(TARGET) # Size of the executable in bytes
|
du -b $(TARGET) # Size of the executable in bytes
|
||||||
|
|
||||||
# Rule to compile source files into object files
|
# Rule to compile source files into object files
|
||||||
|
|
Loading…
Reference in a new issue