You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
alee-forth/Makefile

63 lines
1.7 KiB
Makefile

11 months ago
CXXFLAGS += -std=c++20 -g3 -ggdb -O0 \
2 years ago
-pedantic -Wall -Wextra -Werror -Weffc++ -Wconversion \
11 months ago
-fno-exceptions -fno-rtti
2 years ago
CXXFILES := $(wildcard libalee/*.cpp)
2 years ago
OBJFILES := $(subst .cpp,.o,$(CXXFILES))
LIBFILE := libalee/libalee.a
2 years ago
11 months ago
STANDALONE := forth/core.fth
all: alee
11 months ago
msp430: CXX := msp430-elf-g++
msp430: AR := msp430-elf-gcc-ar
msp430: CXXFLAGS += -I. -I/usr/msp430-elf/usr/include
msp430: CXXFLAGS += -Os -mmcu=msp430fr2476 -ffunction-sections -fdata-sections
msp430: CXXFLAGS += -flto -fno-asynchronous-unwind-tables -fno-threadsafe-statics -fno-stack-protector
msp430: LDFLAGS += -L msp430 -T msp430fr2476.ld -Wl,-gc-sections
msp430: msp430/alee-msp430
2 years ago
msp430-prep: STANDALONE += forth/core-ext.fth forth/tools.fth forth/msp430.fth
11 months ago
msp430-prep: core.fth.h
msp430-prep: clean-lib
11 months ago
11 months ago
small: CXXFLAGS += -Os -fno-asynchronous-unwind-tables -fno-threadsafe-statics -fno-stack-protector
small: alee
fast: CXXFLAGS += -O3 -march=native -mtune=native -flto
fast: alee
2 years ago
standalone: alee-standalone
alee: $(LIBFILE)
msp430/alee-msp430: $(LIBFILE)
2 years ago
alee-standalone: core.fth.h $(LIBFILE)
cppcheck:
cppcheck --enable=warning,style,information --disable=missingInclude \
libalee alee*.cpp *dict.hpp
test: standalone
echo "bye" | ./alee-standalone forth/core-ext.fth tests/src/tester.fr tests/src/core.fr
$(LIBFILE): $(OBJFILES)
$(AR) crs $@ $(OBJFILES)
2 years ago
core.fth.h: alee.dat
xxd -i $< > $@
sed -i "s/unsigned /static &/" $@
11 months ago
alee.dat: alee $(STANDALONE)
echo "3 sys" | ./alee $(STANDALONE)
clean: clean-lib
rm -f alee alee-standalone msp430/alee-msp430
rm -f alee.dat core.fth.h
clean-lib:
rm -f $(LIBFILE) $(OBJFILES)
.PHONY: all clean clean-lib cppcheck fast msp430 small standalone test
2 years ago