-
Notifications
You must be signed in to change notification settings - Fork 50
/
Makefile
88 lines (72 loc) · 2.45 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
include config.mak
vpath=asm:disasm:common:simulate
default:
@mkdir -p build/asm
@mkdir -p build/disasm
@mkdir -p build/table
@mkdir -p build/common
@mkdir -p build/simulate
@mkdir -p build/fileio
$(MAKE) -C build
all: default
.PHONY: library
library:
@$(MAKE) -C build library
%.o: %.c *.h
$(CC) -c $*.c $(CFLAGS) $(LDFLAGS)
install:
install -d $(INSTALL_PREFIX)/bin
install naken_asm $(INSTALL_PREFIX)/bin
install naken_util $(INSTALL_PREFIX)/bin
install -d $(INSTALL_PREFIX)/share/naken_asm
cp -r include $(INSTALL_PREFIX)/share/naken_asm
objs:
@mkdir -f objs
uninstall:
@echo "Removing:"
rm -f $(INSTALL_PREFIX)/bin/naken_asm
rm -f $(INSTALL_PREFIX)/bin/naken_util
rm -rf $(INSTALL_PREFIX)/share/naken_asm
testing_for_mikes_use: launchpad_blink.asm
msp430-as launchpad_blink.asm
msp430-objcopy -F ihex a.out testing.hex
msp430x:
msp430-as testing/msp430x.asm -mmsp430x2619
msp430-objcopy -F ihex a.out msp430x.hex
archive:
ar rvs build/naken_asm.a build/*.o
clean:
@rm -f naken_asm naken_util *.exe *.o *.hex a.out *.lst *.ndbg *.elf *.srec
@rm -rf build/*.o build/*.a
@rm -rf build/asm build/disasm build/table build/common
@rm -rf build/simulate build/fileio
@cd tests/unit/common && make clean
@rm -f tests/unit/eval_expression/unit_test
@rm -f tests/unit/eval_expression_ex/unit_test
@rm -f tests/unit/data/data_test
@rm -f tests/unit/tokens/tokens_test
@rm -f tests/unit/macros/macros_test
@rm -f tests/unit/memory/memory_test
@rm -f tests/unit/symbols/symbols_test
@rm -f tests/unit/util/util_test
@rm -f tests/symbol_address/symbol_address
@echo "Clean!"
.PHONY: tests
tests:
@cd tests/regression && sh regression.sh
@cd tests/unit/eval_expression && make && ./unit_test && make clean
@cd tests/unit/eval_expression_ex && make && ./unit_test && make clean
@cd tests/unit/common && make && make run && make clean
@cd tests/unit/data && make && ./data_test && make clean
@cd tests/unit/tokens && make && ./tokens_test && make clean
@cd tests/unit/macros && make && ./macro_test && make clean
@cd tests/unit/memory && make && ./memory_test && make clean
@cd tests/unit/symbols && make && ./symbols_test && make clean
@cd tests/unit/util && make && ./util_test && make clean
@cd tests/symbol_address && make && ./symbol_address && make clean
@cd tests/other && make && make run && make clean
@cd tests/disasm && make
@cd tests/comparison && make
@cd tests/directives && python3 test.py
distclean: clean
@rm -f config.mak *.asm