alee-forth/Makefile

57 lines
1.5 KiB
Makefile
Raw Normal View History

2023-02-23 18:31:40 -05:00
CXXFLAGS += -std=c++17 -g3 -ggdb -O0 \
2023-03-18 12:40:46 -04:00
-pedantic -Wall -Wextra -Werror -Weffc++ -Wconversion \
2023-03-09 09:16:12 -05:00
-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-18 12:40:46 -04:00
msp430: CXXFLAGS += -I.
2023-03-08 13:41:02 -05:00
msp430: CXXFLAGS += -Os -mmcu=msp430g2553 -ffunction-sections -fdata-sections
msp430: CXXFLAGS += -DMEMDICTSIZE=200 -flto
2023-03-11 10:26:02 -05:00
msp430: LDFLAGS += -L/opt/msp430-elf32/include -Tmsp430/msp430g2553.ld -Wl,-gc-sections
msp430: clean-lib msp430/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-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
2023-03-11 10:26:02 -05:00
echo "\nbye\n" | ./alee-standalone forth/core-ext.fth forth/test/tester.fr forth/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 &/" $@
2023-03-11 10:26:02 -05:00
alee.dat: alee forth/core.fth
2023-03-11 16:24:25 -05:00
echo "3 sys" | ./alee forth/core.fth
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