alee-forth/Makefile

56 lines
1.4 KiB
Makefile
Raw Normal View History

2023-02-23 18:31:40 -05:00
CXXFLAGS += -std=c++17 -g3 -ggdb -O0 \
2023-03-09 09:16:12 -05:00
-pedantic -Wall -Wextra -Werror -Weffc++ \
-fno-exceptions -fno-threadsafe-statics -fno-rtti #-fstack-usage
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-02-24 19:09:53 -05:00
all: alee
msp430: CXX := msp430-elf32-g++
msp430: AR := msp430-elf32-gcc-ar
2023-03-08 13:41:02 -05:00
msp430: CXXFLAGS += -Os -mmcu=msp430g2553 -ffunction-sections -fdata-sections
msp430: CXXFLAGS += -DMEMDICTSIZE=200 -flto
msp430: LDFLAGS += -L/opt/msp430-elf32/include -Tmsp430g2553.ld -Wl,-gc-sections
2023-03-08 19:31:33 -05:00
msp430: clean-lib alee-msp430
2023-02-09 10:30:55 -05:00
2023-02-09 16:41:34 -05:00
small: CXXFLAGS += -Os
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-08 13:41:02 -05:00
standalone: core.fth.h alee-standalone
2023-03-08 13:41:02 -05:00
alee: $(LIBFILE)
2023-02-24 19:09:53 -05:00
alee-msp430: $(LIBFILE)
2023-03-08 13:41:02 -05:00
alee-standalone: $(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 "\nbye\n" | ./alee-standalone core-ext.fth test/tester.fr test/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 $< > $@
sed -i "s/unsigned /static const &/" $@
alee.dat: alee core.fth
echo "2 sys" | ./alee core.fth
2023-03-08 19:31:33 -05:00
clean: clean-lib
2023-03-08 13:41:02 -05:00
rm -f alee alee-msp430 alee-standalone
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