~pixelherodev/zyg

ref: 7dccbd7d9dc502f2cd859c4c7ebd84a0d8f3acd7 zyg/Makefile -rw-r--r-- 597 bytes
7dccbd7dNoam Preil merge 3 months ago
                                                                                
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
.PHONY:all

CFLAGS=-std=c17 -pedantic -Wall -O2 -march=native -g -D _POSIX_C_SOURCE=200809 -Werror -Wextra

all:zyg

zyg: driver.o parser.o lexer.o queue.o sema.o lib/z80e/cpu.o lib/z80e/log.o lib/z80e/registers.o ../lib/libc3.a
	$(CC) -o $@ $^ -lrt $(CFLAGS)

../lib/libc3.a: ../lib/*.c ../lib/codegen/*.c ../lib/sema/*.c
	$(MAKE) -C ../lib

parser.o: EXTRA_CFLAGS := -Wno-sign-compare

%.o: %.c *.h
	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DMACHINE=$(shell uname -m) -c $< -o $@

clean:
	rm -f *.o zyg lib/z80e/*.o

test/%: zyg
	./zyg ./$@.zig -S

testall: zyg
	./test.bash

profile: zyg
	./profile.sh