-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (34 loc) · 865 Bytes
/
Makefile
File metadata and controls
45 lines (34 loc) · 865 Bytes
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
PLATFORM=$(shell uname -s)
ARCH=$(shell uname -m)
SCHEME=petite
ENTRY=scheme_entry
ifeq ($(PLATFORM),Linux)
FORMAT=elf64
NASM=nasm
CC=gcc
endif
# On Darwin this assumes nasm and gcc installed with brew:
# - brew update
# - brew install --HEAD michaelballantyne/homebrew-chez/chez-scheme
# - brew install nasm
# - brew unlink gcc
# - brew install gcc
ifeq ($(PLATFORM),Darwin)
FORMAT=macho64
NASM=/usr/local/bin/nasm
CC=/usr/local/bin/gcc-6
NASM_PREFIX= --prefix _
endif
CFLAGS= -m64 -g -fomit-frame-pointer -Wall -pedantic
NFLAGS= -g $(NASM_PREFIX)
build: clean stst
stst: stst.o startup.c
$(CC) $(CFLAGS) -o stst stst.o startup.c
stst.o: stst.s
$(NASM) $(NFLAGS) -f $(FORMAT) stst.s -o stst.o
clean:
rm -f stst.o stst
test:
ENTRY=$(ENTRY) $(SCHEME) --script auto.scm
.PHONY: build clean test
.SILENT: build clean test stst stst.o