improve Makefile
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
jerry
|
||||||
|
|
||||||
# Compiled Object files
|
# Compiled Object files
|
||||||
*.slo
|
*.slo
|
||||||
*.lo
|
*.lo
|
||||||
|
|||||||
@@ -33,30 +33,42 @@ OBJDUMP = $(CROSS_COMPILE)objdump
|
|||||||
OBJCOPY = $(CROSS_COMPILE)objcopy
|
OBJCOPY = $(CROSS_COMPILE)objcopy
|
||||||
SIZE = $(CROSS_COMPILE)size
|
SIZE = $(CROSS_COMPILE)size
|
||||||
|
|
||||||
CFLAGS ?= -Wall -std=c99 -Wextra -Wpedantic -fdiagnostics-color=always
|
# General flags
|
||||||
#CFLAGS += -Werror
|
CFLAGS ?= $(INCLUDES) -Wall -std=c99 -fdiagnostics-color=always
|
||||||
#CFLAGS += -Wformat-security -Wformat-nonliteral -Winit-self
|
CFLAGS += -Wextra -Wpedantic -Wformat-security -Wlogical-op
|
||||||
#CFLAGS += -Wconversion -Wsign-conversion -Wlogical-op
|
CFLAGS += -Wformat-nonliteral -Winit-self -Wstack-protector
|
||||||
#CFLAGS += -Wstrict-prototypes -Wmissing-prototypes
|
CFLAGS += -Wconversion -Wsign-conversion -Winline
|
||||||
#CFLAGS += -Winline -Wstack-protector
|
CFLAGS += -Wstrict-prototypes -Wmissing-prototypes
|
||||||
|
|
||||||
|
# Flags for MCU
|
||||||
#CFLAGS += -mlittle-endian -mcpu=cortex-m4 -march=armv7e-m -mthumb
|
#CFLAGS += -mlittle-endian -mcpu=cortex-m4 -march=armv7e-m -mthumb
|
||||||
#CFLAGS += -mfpu=fpv4-sp-d16 -mfloat-abi=hard
|
#CFLAGS += -mfpu=fpv4-sp-d16 -mfloat-abi=hard
|
||||||
#CFLAGS += -ffunction-sections -fdata-sections
|
#CFLAGS += -ffunction-sections -fdata-sections
|
||||||
|
|
||||||
#DEBUG_OPTIONS = -fsanitize=address -g3 -O0
|
DEBUG_OPTIONS = -fsanitize=address -g3 -O0 -DDEBUG
|
||||||
#RELEASE_OPTIONS = -Os
|
RELEASE_OPTIONS = -Os -Werror
|
||||||
|
|
||||||
HEADERS = error.h lexer.h pretty-printer.h parser.h
|
all: debug
|
||||||
#OBJS = lexer.o pretty-printer.o parser.o main.o
|
|
||||||
DEFINES = -DDEBUG
|
|
||||||
|
|
||||||
all:
|
debug:
|
||||||
$(CC) $(INCLUDES) $(CFLAGS) $(DEBUG_OPTIONS) $(DEFINES) $(SOURCES) \
|
$(CC) $(INCLUDES) $(CFLAGS) $(DEBUG_OPTIONS) $(SOURCES) \
|
||||||
|
-o $(TARGET)
|
||||||
|
|
||||||
|
release:
|
||||||
|
$(CC) $(INCLUDES) $(CFLAGS) $(RELEASE_OPTIONS) $(SOURCES) \
|
||||||
-o $(TARGET)
|
-o $(TARGET)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OBJ_DIR)/*.o *.o $(TARGET)
|
rm -f $(OBJ_DIR)/*.o *.o
|
||||||
|
rm -f $(TARGET)
|
||||||
|
rm -f $(TARGET).elf
|
||||||
|
rm -f $(TARGET).bin
|
||||||
|
rm -f $(TARGET).map
|
||||||
|
rm -f $(TARGET).hex
|
||||||
|
rm -f $(TARGET).lst
|
||||||
|
|
||||||
|
install:
|
||||||
|
st-flash write $(TARGET).bin 0x08000000
|
||||||
|
|
||||||
test:
|
test:
|
||||||
./tools/jerry_test.sh
|
./tools/jerry_test.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user