forked from uli/basicengine-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.dos
52 lines (39 loc) · 1.63 KB
/
Makefile.dos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
TARGET = basic.exe
SOURCES = $(shell ls libraries/lua/*.cpp) $(shell ls ttbasic/*.cpp) $(shell ls libraries/TTBAS_LIB/*.cpp) \
$(shell ls libraries/ESP8266SAM/src/*.cpp) $(shell ls libraries/TTVoutfonts/*.cpp) \
$(shell ls libraries/azip/*.cpp) \
$(shell ls dos/*.cpp) \
$(shell ls arduino_compat/*.cpp)
SOURCES_C = $(shell ls ttbasic/*.c) $(shell ls dos/*.c) $(shell ls dos/sound.lib/*.c)
OBJS = $(SOURCES:.cpp=.o) $(SOURCES_C:.c=.o)
PROF = $(SOURCES:.cpp=.gcda) $(SOURCES:.cpp=.gcno) \
$(SOURCES_C:.c=.gcda) $(SOURCES_C:.c=.gcno)
LIBS = -lstdc++ -lalleg
CROSS_COMPILE=/usr/local/djgpp/bin/i586-pc-msdosdjgpp-
CC=$(CROSS_COMPILE)gcc
CXX=$(CROSS_COMPILE)g++
INCLUDE = -Ilibraries/TTVoutfonts -Ilibraries/TTBAS_LIB -Ilibraries/TKeyboard/src \
-Ilibraries/ESP8266SAM/src -Ilibraries/azip -Ilibraries/lua
ARDFLAGS = -gdwarf-2 -MMD -O3 -funroll-loops -fomit-frame-pointer -fno-exceptions -mtune=i586 -g -Idos -Iarduino_compat -Ittbasic $(INCLUDE) \
-Wall -Wno-unused -D_GNU_SOURCE -D__DOS__ -DZDM
CFLAGS += $(ARDFLAGS)
#CFLAGS += -m32
#CFLAGS += -fprofile-arcs -ftest-coverage
CXXFLAGS += $(ARDFLAGS) -fpermissive -std=c++11 -fno-exceptions -U__STRICT_ANSI__
$(TARGET): $(OBJS)
$(CXX) $(CFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
image: $(TARGET)
upx $(TARGET) || true
sudo mount -o loop FLOPPY.img /mnt
sudo cp $(TARGET) /mnt
sudo umount /mnt
clean:
rm -f $(OBJS) $(OBJS:%.o=%.d) $(PROF)
$(MAKE) -C ttbasic -f autogen.mk autogen_clean
gcov:
rm -f *.gcov
$(CROSS_COMPILE)gcov $(SOURCES) $(SOURCES_C)
ttbasic/funtbl.h: ttbasic/icode.txt
$(MAKE) -C ttbasic -f autogen.mk funtbl.h epigrams.h version.h
$(OBJS): ttbasic/funtbl.h
-include $(OBJS:%.o=%.d)