tests for variable argument lists
[qbe.git] / Makefile
blobfc649f849e057b996dbd6bfc3861023be91c8a6b
1 BIN = qbe
2 ABI = sysv
4 V = @
5 OBJDIR = obj
7 SRC = main.c util.c parse.c cfg.c mem.c ssa.c alias.c load.c copy.c fold.c live.c $(ABI).c isel.c spill.c rega.c emit.c
8 OBJ = $(SRC:%.c=$(OBJDIR)/%.o)
10 CFLAGS += -Wall -Wextra -std=c99 -g -pedantic
12 $(OBJDIR)/$(BIN): $(OBJ) $(OBJDIR)/timestamp
13 @test -z "$(V)" || echo "ld $@"
14 $(V)$(CC) $(LDFLAGS) $(OBJ) -o $@
16 $(OBJDIR)/%.o: %.c $(OBJDIR)/timestamp
17 @test -z "$(V)" || echo "cc $<"
18 $(V)$(CC) $(CFLAGS) -c $< -o $@
20 $(OBJDIR)/timestamp:
21 @mkdir -p $(OBJDIR)
22 @touch $@
24 $(OBJ): all.h
25 obj/main.o: config.h
27 config.h:
28 @case `uname` in \
29 *Darwin*) echo "#define Defaultasm Gasmacho" ;; \
30 *) echo "#define Defaultasm Gaself" ;; \
31 esac > $@
33 clean:
34 rm -fr $(OBJDIR)
36 clean-gen: clean
37 rm -f config.h
39 check: $(OBJDIR)/$(BIN)
40 tools/unit.sh all
42 80:
43 @for F in $(SRC); \
44 do \
45 awk "{ \
46 gsub(/\\t/, \" \"); \
47 if (length(\$$0) > $@) \
48 printf(\"$$F:%d: %s\\n\", NR, \$$0); \
49 }" < $$F; \
50 done
52 .PHONY: clean clean-gen check 80 syndoc