-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.osx
More file actions
80 lines (56 loc) · 1.56 KB
/
Copy pathMakefile.osx
File metadata and controls
80 lines (56 loc) · 1.56 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
TARGET = symta
INCLUDE = -I ./runtime -I ./runtime/osx
PREFIX =
CC = $(PREFIX)gcc
rt="./runtime/osx/"
CFLAGS = -O2 -Wno-return-type -Wno-pointer-sign $(INCLUDE)
#CFLAGS = -g -O0 -Wno-return-type -Wno-pointer-sign $(INCLUDE)
EXTRA_CFLAGS =
#-fno-stack-protector
AS = $(CC)
ASFLAGS = $(LOC) -Wall
LD = $(CC) -Wl,-no_pie -Wl,-image_base -Wl,0x100000000 \
-Wl,-stack_size -Wl,0xA00000
# -Wl,-allow_stack_execute
LDFLAGS = $(LOC)
AR = $(PREFIX)ar
ARFLAGS = rcs
STRIP = $(PREFIX)strip
CP = cp -fp
RM = rm -f
SRCS = main.c gc.c ncm.c bltin.c tokenize.c reader.c meta_table.c ng.c \
sif.c fs.c sbc.c sif2sbc.c jit.c jit_sbc.c \
sffi/sffi.c sffi/arch_x64_sysv.c \
osx/ctx.c osx/compat.c
HDRSB = symta.h common.h ng.h prf.h dh.h ih.h th.h am.h nb.h nh.h fs.h sif.h flt16.h flt16_x86.h meta_table.h sffi/sffi.h jit.h
HDRS = $(addprefix runtime/,$(HDRSB))
OBJS = $(addprefix build/rt/,$(SRCS:.c=.o))
OBJA =
#$(info $$OBJS is [${OBJS}])
all: $(TARGET)
test:
@echo "hello"
lib/:
mkdir lib
src/%.h:
@echo "header \"$@\" is missing"
@exit -1
# -save-temps=obj
build/rt/ncm.o: runtime/ncm.h
build/rt/gc.o: runtime/gc_types.h
build/rt/osx:
@mkdir -p build/rt/osx
@mkdir -p build/rt/sffi
build/rt/%.o: runtime/%.c $(HDRS)
@echo CC $<
@$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
$(TARGET): build/rt/osx $(OBJS) $(OBJA)
@echo LINK $@
@$(LD) -o $@ $(OBJS) $(OBJA) $(LDFLAGS)
lib/util: lib/ $(OBJS) lib/util.o $(OBJA)
$(LD) -o $@ $(OBJS) lib/util.o $(OBJA) $(LDFLAGS)
.PHONY: install uninstall clean
clean:
-$(RM) $(TARGET)
-$(RM) *.o
-$(RM) *.exe