-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile.elks
More file actions
56 lines (45 loc) · 1.53 KB
/
Makefile.elks
File metadata and controls
56 lines (45 loc) · 1.53 KB
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
# C86 Makefile for ELKS using OpenWatcom C
############# Standard Section for Open Watcom C ##############
ifndef TOPDIR
$(error ELKS TOPDIR is not defined)
endif
ifndef WATCOM
$(error OpenWatcom WATCOM is not defined)
endif
CC = owcc
LD = owcc
CLBASE = -mcmodel=l
CLBASE += -bnone -march=i86 -std=c99
CLBASE += -fno-stack-check -fnostdlib -fsigned-char
CLBASE += -Wc,-fpc -Wc,-zev -Wc,-zls -Wc,-x -Wc,-wcd=303
WARNINGS = -Wall -Wextra
INCLUDES = -I$(TOPDIR)/libc/include -I$(TOPDIR)/elks/include
INCLUDES += -I$(TOPDIR)/libc/include/watcom
DEFINES = -D__ELKS__ -DLUA_USE_C89
CFLAGS = -Os $(CLBASE) $(WARNINGS) $(INCLUDES) $(DEFINES) $(LOCALFLAGS)
LDBASE = -bos2 -s
LDBASE += -Wl,option -Wl,dosseg
LDBASE += -Wl,option -Wl,start=_start
LDBASE += -Wl,option -Wl,nodefaultlibs
LDBASE += -Wl,option -Wl,stack=0x6000
LDBASE += -Wl,option -Wl,heapsize=512
LDFLAGS = $(LDBASE)
LDLIBS = -Wl,library -Wl,$(TOPDIR)/libc/libcl.lib -lm
OBJS = $(SRCS:.c=.obj)
%.obj: %.c
$(CC) -c $(CFLAGS) -o $*.obj $<
############# End of Standard Section ##############
BINDIR = ../elks-bin
LOCALFLAGS = -DNDEBUG
PROG = lua
SRCS = lua.c mem.c lmathlib.c lapi.c lctype.c lfunc.c loslib.c \
ltable.c lundump.c lauxlib.c ldblib.c lgc.c lmem.c \
lparser.c ltablib.c lutf8lib.c lbaselib.c ldebug.c \
linit.c loadlib.c lstate.c ltm.c lvm.c lcode.c \
ldo.c liolib.c lobject.c lstring.c lzio.c \
lcorolib.c ldump.c llex.c lopcodes.c lstrlib.c \
all: $(PROG)
$(PROG): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
clean:
rm -f $(PROG) *.obj tmp.h