-
Notifications
You must be signed in to change notification settings - Fork 3
/
OfrontPlus.mak
83 lines (58 loc) · 1.95 KB
/
OfrontPlus.mak
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
#
# Simple Makefile for using with Ofront+ compiler.
#
# FIXME: Need to figure out how to detect the information
# needed to set the flags correctly for Ofront+
# Questions to get sorted:
#
# 1. Set up import paths for modules (e.g. pure Oberon, Ofront specific)
# 2. Where are the standard modules or do I need to write them?
#
# Defaults
#OC = ofont+
OC=$(shell which ofront+)
OPT = -7
MODULES = $(shell ls -1 *.Mod | grep -v -E Test.Mod | sed -E "s/.Mod$$//")
TEST_NAMES = $(shell ls -1 *.Mod | grep -E Test.Mod | sed -E "s/.Mod$$//")
PROG_NAMES = #$(shell ls -1 *CmdLn.Mod | sed -E "s/.CmdLn.Mod$$//")
PLATFORM = $(shell uname -i)
OS = $(shell uname)
OPT =
ifeq ($(PLATFORM), x86_64)
OPT = -7 -88 -s
else ifeq ($(PLATFORM), x86_32)
OPT = -7 -44 -s
else ifeq ($(PLATFORM), arm7)
OPT = -7 -48 -s
endif
EXT =
ifeq ($(OS), Windows)
EXT = .exe
OPT = -7 -s -48
endif
build: modules test programs
modules: $(MODULES)
programs: $(PROG_NAMES)
$(MODULES):
@mkdir -p bin
$(OC) $(OPT) $@.Mod
$(PROG_NAMES): $(MODULES)
@mkdir -p bin
$(OC) $(OPT) $@.Mod
$(TEST_NAMES): .FORCE
$(OC) $(OPT) "$@.Mod" -m
full_test: .FORCE clean test
test: ../Tests.Mod $(TEST_NAMES)
@for FNAME in $(TEST_NAMES); do "./$${FNAME}"; done
clean: .FORCE
@for FNAME in $(PROG_NAMES); do if [ -f "$${FNAME}$(EXT)" ]; then rm -v "$${FNAME}$(EXT)"; fi; done
@for FNAME in $(PROG_NAMES); do if [ -f "$${FNAME}.c" ] || [ -f "$${FNAME}.h" ] || [ -f "$${FNAME}.sym" ]; then rm -v "$${FNAME}.(c|h|sym)"; fi; done
@for FNAME in $(TEST_NAMES); do if [ -f "$${FNAME}$(EXT)" ]; then rm -v "$${FNAME}$(EXT)"; fi; done
@for FNAME in $(TEST_NAMES); do if [ -f "$${FNAME}.c" ] || [ -f "$${FNAME}.h" ] || [ -f "$${FNAME}.sym" ]; then rm -v "$${FNAME}.(c|h|sym)"; fi; done
@for FNAME in $(MODULES); do if [ -f "$${FNAME}.c" ] || [ -f "$${FNAME}.h" ] || [ -f "$${FNAME}.sym" ]; then rm -v "$${FNAME}.(c|h|sym)"; fi; done
save:
git commit -am "$(MSG)"
git push origin $(BRANCH)
status:
git status
.FORCE: