summary refs log tree commit diff
path: root/src/Makefile
blob: 6adfbd3a67bd4a219aaf68de6fa0b10ce9ad2350 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
BIN = qbe
OBJ = main.o util.o parse.o mem.o ssa.o copy.o live.o isel.o spill.o rega.o emit.o

CFLAGS += -Wall -Wextra -std=c99 -g -pedantic

$(BIN): $(OBJ)
	$(CC) $(LDFLAGS) $(OBJ) -o $@

$(OBJ): all.h config.h

config.h:
	@case `uname` in                                \
	*Darwin*) echo "#define Defaultasm Gasmacho" ;; \
	*Linux*)  echo "#define Defaultasm Gaself" ;;   \
	esac > $@


all: $(BIN)
clean:
	rm -f $(BIN) $(OBJ)
check: $(BIN)
	../test/go.sh all

.PHONY: all clean check syndoc