~pixelherodev/zyg

ref: a5c2d48fcc5c0a0d5a4e8be9ec02dda5e35d7028 zyg/Makefile -rw-r--r-- 615 bytes
a5c2d48fNoam Preil merge 11 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=c99 -pedantic -Wall -O2 -march=native -g -D _POSIX_C_SOURCE=200809 -Werror=implicit-function-declaration

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
	$(CC) -o $@ $^ -lrt -lc3 $(CFLAGS)

driver.o lib/z80e/cpu.o lib/z80e/log.o lib/z80e/registers.o: EXTRA_CFLAGS := -Wno-pedantic

make.conf:
	uname -m >make.conf

%.o: %.c *.h make.conf
	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DMACHINE=`cat make.conf` -c $< -o $@

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

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

testall: zyg
	./test.bash

profile: zyg
	./profile.sh