regenerate test/vararg2.ssa
[qbe.git] / Makefile
blob18a50666fc9d4208d4f56bae9b2b3bbdc3018f55
1 .POSIX:
2 .SUFFIXES: .o .c
4 PREFIX = /usr/local
5 BINDIR = $(PREFIX)/bin
7 COMMOBJ = main.o util.o parse.o cfg.o mem.o ssa.o alias.o load.o copy.o \
8 fold.o live.o spill.o rega.o gas.o
9 AMD64OBJ = amd64/targ.o amd64/sysv.o amd64/isel.o amd64/emit.o
10 ARM64OBJ = arm64/targ.o arm64/abi.o arm64/isel.o arm64/emit.o
11 RV64OBJ = rv64/targ.o rv64/abi.o rv64/isel.o rv64/emit.o
12 OBJ = $(COMMOBJ) $(AMD64OBJ) $(ARM64OBJ) $(RV64OBJ)
14 SRCALL = $(OBJ:.o=.c)
16 CFLAGS = $(CPPFLAGS) -Wall -Wextra -std=c99 -g -Wpedantic
18 qbe: $(OBJ)
19 $(CC) $(LDFLAGS) $(OBJ) -o $@
21 .c.o:
22 $(CC) $(CFLAGS) -c $< -o $@
24 $(OBJ): all.h ops.h
25 $(AMD64OBJ): amd64/all.h
26 $(ARM64OBJ): arm64/all.h
27 $(RV64OBJ): rv64/all.h
28 main.o: config.h
30 config.h:
31 @case `uname` in \
32 *Darwin*) \
33 echo "#define Defasm Gasmacho"; \
34 echo "#define Deftgt T_amd64_sysv"; \
35 ;; \
36 *) \
37 echo "#define Defasm Gaself"; \
38 case `uname -m` in \
39 *aarch64*) \
40 echo "#define Deftgt T_arm64"; \
41 ;; \
42 *riscv64*) \
43 echo "#define Deftgt T_rv64"; \
44 ;; \
45 *) \
46 echo "#define Deftgt T_amd64_sysv";\
47 ;; \
48 esac \
49 ;; \
50 esac > $@
52 install: qbe
53 mkdir -p "$(DESTDIR)$(BINDIR)"
54 install -m755 qbe "$(DESTDIR)$(BINDIR)/qbe"
56 uninstall:
57 rm -f "$(DESTDIR)$(BINDIR)/qbe"
59 clean:
60 rm -f *.o */*.o qbe
62 clean-gen: clean
63 rm -f config.h
65 check: qbe
66 tools/test.sh all
68 check-arm64: qbe
69 TARGET=arm64 tools/test.sh all
71 check-rv64: qbe
72 TARGET=rv64 tools/test.sh all
74 src:
75 @echo $(SRCALL)
77 80:
78 @for F in $(SRCALL); \
79 do \
80 awk "{ \
81 gsub(/\\t/, \" \"); \
82 if (length(\$$0) > $@) \
83 printf(\"$$F:%d: %s\\n\", NR, \$$0); \
84 }" < $$F; \
85 done
87 .PHONY: clean clean-gen check check-arm64 src 80 install uninstall