forked from alexfru/dflat20
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.elks
153 lines (122 loc) · 3.83 KB
/
Makefile.elks
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# External ELKS application Makefile
TOPDIR = /Users/greg/net/elks-gh
###############################################################################
include $(TOPDIR)/.config
INCLUDES = -I$(TOPDIR)/include -I$(TOPDIR)/libc/include -I$(TOPDIR)/elks/include
TINYPRINTF = $(ELKSCMD_DIR)/lib/tiny_vfprintf.o
# Compiler variables for ELKS.
CC = ia16-elf-gcc
HOSTCC = cc
CFLBASE = -fno-inline -melks-libc -mtune=i8086 -Wall -Os
#CFLBASE += -mcmodel=small -mno-segment-relocation-stuff
CFLBASE += -mcmodel=medium -msegment-relocation-stuff -ffunction-sections
CFLAGS = $(CFLBASE) $(WARNINGS) $(LOCALFLAGS) $(INCLUDES)
LD = ia16-elf-gcc
LDFLAGS = $(CFLBASE)
AS = ia16-elf-as
ASFLAGS = -mtune=i8086 --32-segelf
AR = ia16-elf-ar
# Standard compilation rules.
.S.s:
$(CC) -E -traditional $(INCLUDES) $(CCDEFS) -o $*.s $<
.S.o:
$(CC) -E -traditional $(INCLUDES) $(CCDEFS) -o $*.tmp $<
$(AS) $(ASFLAGS) -o $*.o $*.tmp
rm -f $*.tmp
.s.o:
$(AS) $(ASFLAGS) -o $*.o $<
.c.o:
$(CC) $(CFLAGS) -c -o $*.o $<
###############################################################################
#-------------------------------------------------------------------
# D - F L A T M A K E F I L E - ELKS
#-------------------------------------------------------------------
TOPDIR = /Users/greg/net/elks-gh
SMALL=
FULL=
ifeq ($(SMALL),y)
PRGS = smallpad
else
PRGS = memopad
#PRGS = memopad huffc fixhelp memopad.hlp
endif
LIBS = libdflat.a
all: $(LIBS) $(PRGS)
clean:
rm -f *.o *.a memopad smallpad huffc fixhelp memopad.hlp
ifeq ($(SMALL),y)
BUILDOPTS = -DBUILD_SMALL_DFLAT
endif
ifeq ($(FULL),y)
BUILDOPTS = -DBUILD_FULL_DFLAT
endif
CFLAGS += $(BUILDOPTS) -DELKS=1
CFLAGS += -Wno-pointer-sign
CFLAGS += -Wno-misleading-indentation -Wno-unused-function -Wno-unused-variable
#CFLAGS += -Wno-compare-distinct-pointer-types
#CFLAGS += -Wno-invalid-source-encoding
LDFLAGS += -maout-heap=0xffff
OBJS = memopad.o dialogs.o menus.o
memopad: $(OBJS) $(LIBS)
$(LD) $(LDFLAGS) -o $@ $(OBJS) -L. -ldflat
cp $@ $(TOPDIR)/elkscmd/rootfs_template/root
SMALLOBJS = smallpad.o
smallpad: $(SMALLOBJS) $(LIBS)
$(CC) $(LDFLAGS) -o $@ $(SMALLOBJS) -L. -ldflat
cp $@ $(TOPDIR)/elkscmd/rootfs_template/root
CONSOBJS = cons.o runes.o kcp437.o
cons: $(CONSOBJS)
$(LD) $(LDFLAGS) -o $@ $(CONSOBJS)
cp cons $(TOPDIR)/elkscmd/rootfs_template/root
TTYOBJS = ttyinfo.o peekpoke.o runes.o unikey.o tty.o
ttyinfo: $(TTYOBJS)
$(LD) $(LDFLAGS) -o $@ $(TTYOBJS)
cp ttyinfo $(TOPDIR)/elkscmd/rootfs_template/root
MATRIXOBJS = matrix.o tty.o tty-cp437.o runes.o kcp437.o
matrix: $(MATRIXOBJS)
$(CC) $(LDFLAGS) -o $@ $(MATRIXOBJS)
cp $@ $(TOPDIR)/elkscmd/rootfs_template/root
TESTOBJS = test.o peekpoke.o
test: $(TESTOBJS)
$(LD) $(LDFLAGS) -o $@ $(TESTOBJS)
cp test $(TOPDIR)/elkscmd/rootfs_template/root
DFLATOBJS = \
message.o keys.o \
config.o dfalloc.o \
window.o rect.o lists.o \
normal.o applicat.o textbox.o \
menubar.o menu.o popdown.o listbox.o \
editbox.o editor.o \
sysmenu.o \
statbar.o
ifneq ($(SMALL),y)
DFLATOBJS += \
dialbox.o msgbox.o \
box.o text.o \
button.o radio.o checkbox.o spinbutt.o \
combobox.o slidebox.o \
fileopen.o direct.o \
pictbox.o calendar.o barchart.o \
search.o clipbord.o \
helpbox.o decomp.o \
log.o \
watch.o
endif
DFLATOBJS += \
video.o events-unix.o mouse-ansi.o console-unix.o \
kcp437.o runes.o unikey.o tty.o tty-cp437.o runshell.o
DFLATOBJS += v7malloc.o
$(LIBS): $(DFLATOBJS)
$(AR) rcs $(LIBS) $(DFLATOBJS)
huff.o: huff.c
$(HOSTCC) -c -o $@ $^
HUFFOBJS = huffc.o htree.o
huffc: $(HUFFOBJS)
$(HOSTCC) $(LDFLAGS) -o $@ $(HUFFOBJS)
FIXHOBJS = fixhelp.o decomp.o
fixhelp: $(FIXHOBJS)
$(HOSTCC) $(LDFLAGS) -o $@ $(FIXHOBJS)
memopad.hlp: memopad.txt huffc fixhelp
./huffc memopad.txt memopad.hlp
./fixhelp memopad
cp mempad.hlp $(TOPDIR)/elkscmd/rootfs_template/root