alee-forth/Makefile

63 lines
1.7 KiB
Makefile
Raw Normal View History

2023-10-14 17:38:44 -04:00
CXXFLAGS += -std=c++20 -g3 -ggdb -O0 \
2023-03-18 12:40:46 -04:00
-pedantic -Wall -Wextra -Werror -Weffc++ -Wconversion \
2023-10-14 17:38:44 -04:00
-fno-exceptions -fno-rtti
2023-02-09 10:30:55 -05:00
2023-03-08 19:57:26 -05:00
CXXFILES := $(wildcard libalee/*.cpp)
2023-02-09 10:30:55 -05:00
OBJFILES := $(subst .cpp,.o,$(CXXFILES))
2023-03-08 19:57:26 -05:00
LIBFILE := libalee/libalee.a
2023-02-09 10:30:55 -05:00
2023-10-14 19:17:59 -04:00
STANDALONE := forth/core.fth
2023-02-24 19:09:53 -05:00
all: alee
2023-10-14 17:38:44 -04:00
msp430: CXX := msp430-elf-g++
msp430: AR := msp430-elf-gcc-ar
2023-11-02 08:17:07 -04:00
msp430: CXXFLAGS += -I. -I/usr/msp430-elf/usr/include
msp430: CXXFLAGS += -Os -mmcu=msp430fr2476 -ffunction-sections -fdata-sections
2023-11-05 07:21:46 -05:00
msp430: CXXFLAGS += -flto -fno-asynchronous-unwind-tables -fno-threadsafe-statics -fno-stack-protector
msp430: LDFLAGS += -L msp430 -T msp430fr2476.ld -Wl,-gc-sections
2023-11-02 20:50:47 -04:00
msp430: msp430/alee-msp430
2023-02-09 10:30:55 -05:00
2023-11-02 21:37:34 -04:00
msp430-prep: STANDALONE += forth/core-ext.fth forth/tools.fth forth/msp430.fth
2023-10-14 19:17:59 -04:00
msp430-prep: core.fth.h
2023-11-02 20:50:47 -04:00
msp430-prep: clean-lib
2023-10-14 19:17:59 -04:00
2023-10-14 17:38:44 -04:00
small: CXXFLAGS += -Os -fno-asynchronous-unwind-tables -fno-threadsafe-statics -fno-stack-protector
2023-02-24 19:09:53 -05:00
small: alee
2023-02-09 16:41:34 -05:00
2023-02-26 19:31:00 -05:00
fast: CXXFLAGS += -O3 -march=native -mtune=native -flto
2023-02-24 19:09:53 -05:00
fast: alee
2023-03-14 09:44:08 -04:00
standalone: alee-standalone
2023-03-08 13:41:02 -05:00
alee: $(LIBFILE)
2023-03-11 10:26:02 -05:00
msp430/alee-msp430: $(LIBFILE)
2023-03-14 09:44:08 -04:00
alee-standalone: core.fth.h $(LIBFILE)
2023-02-09 16:41:34 -05:00
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
2023-02-09 16:41:34 -05:00
$(LIBFILE): $(OBJFILES)
$(AR) crs $@ $(OBJFILES)
2023-02-09 10:30:55 -05:00
2023-03-08 13:41:02 -05:00
core.fth.h: alee.dat
xxd -i $< > $@
2023-11-02 20:50:47 -04:00
sed -i "s/unsigned /static &/" $@
2023-03-08 13:41:02 -05:00
2023-10-14 19:17:59 -04:00
alee.dat: alee $(STANDALONE)
echo "3 sys" | ./alee $(STANDALONE)
2023-03-08 13:41:02 -05:00
2023-03-08 19:31:33 -05:00
clean: clean-lib
2023-03-11 10:26:02 -05:00
rm -f alee alee-standalone msp430/alee-msp430
2023-03-08 19:31:33 -05:00
rm -f alee.dat core.fth.h
2023-03-08 13:41:02 -05:00
2023-03-08 19:31:33 -05:00
clean-lib:
rm -f $(LIBFILE) $(OBJFILES)
.PHONY: all clean clean-lib cppcheck fast msp430 small standalone test
2023-02-09 10:30:55 -05:00