-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
55 lines (46 loc) · 1.86 KB
/
Makefile
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
53
54
55
# Use a symlink from pe32me162ir_pub.ino to pe32me162ir_pub.cc (and not
# to the more common .cpp) because g++ and make will correctly guess
# their type, while the Arduino IDE does not open the .cpp file as well
# (it already has this file open as the ino file).
HEADERS = $(wildcard *.h bogoduino/*.h)
OBJECTS = pe32me162ir_pub.o \
$(filter-out bogoduino/bogoduino.o, \
$(addsuffix .o, $(basename $(wildcard bogoduino/*.cpp))))
# --- Arduino Uno AVR (8-bit RISC, by Atmel) ---
# /snap/arduino/current/hardware/arduino/avr/boards.txt:
# uno.build.mcu=atmega328p
# uno.build.f_cpu=16000000L
# uno.build.board=AVR_UNO
# uno.build.core=arduino
# uno.build.variant=standard
#CXX = /snap/arduino/current/hardware/tools/avr/bin/avr-gcc
#CPPFLAGS = \
# -DARDUINO=10813 -DARDUINO_ARCH_AVR=1 -DARDUINO_AVR_UNO=1 \
# -D__AVR_ATmega328P__ -DF_CPU=16000000 -D__ATTR_PROGMEM__=
#CXXFLAGS = \
# -O \
# -I/snap/arduino/current/hardware/tools/avr/avr/include \
# -I/snap/arduino/current/hardware/arduino/avr/cores/arduino \
# -I/snap/arduino/current/hardware/arduino/avr/variants/standard \
# -I../../libraries/CustomSoftwareSerial/src
# --- NodeMcu ESP8266 Xtensa (32-bit RISC) ---
#CXX = $(HOME)/snap/arduino/current/.arduino15/packages/esp8266/tools/\
#xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-gcc
# --- Test mode ---
CXX = g++
CPPFLAGS = -DTEST_BUILD -g -I./bogoduino
CXXFLAGS = -Wall -Os -fdata-sections -ffunction-sections
LDFLAGS = -Wl,--gc-sections # -s(trip)
test: ./pe32me162ir_pub.test
./pe32me162ir_pub.test
clean:
$(RM) $(OBJECTS) ./pe32me162ir_pub.test
example.diff: example.log
bash -c "diff -u \
<(git show HEAD:example.log | sed -e 's/^[^-]*-> //') \
<(sed -e 's/^[^-]*-> //' example.log)" | less; true
example.log: raw.log
./raw2example < raw.log > example.log
$(OBJECTS): $(HEADERS)
pe32me162ir_pub.test: $(OBJECTS)
$(LINK.cc) -o $@ $^