7 SRC
= main.c util.c parse.c cfg.c mem.c ssa.c alias.c load.c copy.c \
8 fold.c live.c spill.c rega.c gas.c
9 AMD64SRC
= amd64
/targ.c amd64
/sysv.c amd64
/isel.c amd64
/emit.c
10 ARM64SRC
= arm64
/targ.c arm64
/abi.c arm64
/isel.c arm64
/emit.c
11 RV64SRC
= rv64
/targ.c rv64
/abi.c rv64
/isel.c rv64
/emit.c
12 SRCALL
= $(SRC
) $(AMD64SRC
) $(ARM64SRC
) $(RV64SRC
)
14 AMD64OBJ
= $(AMD64SRC
:.c
=.o
)
15 ARM64OBJ
= $(ARM64SRC
:.c
=.o
)
16 RV64OBJ
= $(RV64SRC
:.c
=.o
)
17 OBJ
= $(SRC
:.c
=.o
) $(AMD64OBJ
) $(ARM64OBJ
) $(RV64OBJ
)
19 CFLAGS
= $(CPPFLAGS
) -Wall
-Wextra
-std
=c99
-g
-Wpedantic
22 $(CC
) $(LDFLAGS
) $(OBJ
) -o
$@
25 $(CC
) $(CFLAGS
) -c
$< -o
$@
28 $(AMD64OBJ
): amd64
/all.h
29 $(ARM64OBJ
): arm64
/all.h
30 $(RV64OBJ
): rv64
/all.h
36 echo
"#define Defasm Gasmacho"; \
37 echo
"#define Deftgt T_amd64_sysv"; \
40 echo
"#define Defasm Gaself"; \
43 echo
"#define Deftgt T_arm64"; \
46 echo
"#define Deftgt T_rv64"; \
49 echo
"#define Deftgt T_amd64_sysv";\
56 mkdir
-p
"$(DESTDIR)$(BINDIR)"
57 install -m755 qbe
"$(DESTDIR)$(BINDIR)/qbe"
60 rm -f
"$(DESTDIR)$(BINDIR)/qbe"
72 TARGET
=arm64 tools
/test.sh
all
75 TARGET
=rv64 tools
/test.sh
all
81 @for F in
$(SRCALL
); \
85 if (length(\$$0) > $@) \
86 printf(\"$$F:%d: %s\\n\", NR, \$$0); \
90 .PHONY
: clean clean-gen
check check-arm64 src
80 install uninstall