Makefile (1221B)
1 .POSIX: 2 3 DIRS =\ 4 amd64-sysv\ 5 arm64-sysv\ 6 i386-sysv\ 7 qbe\ 8 qbe_amd64-sysv\ 9 qbe_arm64-sysv\ 10 z80-scc\ 11 12 PROJECTDIR = ../../../.. 13 include $(PROJECTDIR)/scripts/rules.mk 14 15 MORE_LDLIBS = -lscc 16 17 QBE_OBJS =\ 18 code.o\ 19 main.o\ 20 node.o\ 21 parser.o\ 22 sethi.o\ 23 swtch.o\ 24 symbol.o\ 25 26 OBJS =\ 27 cfg.o\ 28 $(QBE_OBJS)\ 29 30 QBE_AMD64_SYSV_OBJS=\ 31 qbe_amd64-sysv/builtin.o\ 32 $(QBE_OBJS)\ 33 34 QBE_ARM64_SYSV_OBJS=\ 35 qbe_arm64-sysv/builtin.o\ 36 $(QBE_OBJS)\ 37 38 Z80_SCC_OBJS =\ 39 z80-scc/builtin.o\ 40 $(OBJS) \ 41 42 TARGET =\ 43 cc2-qbe_amd64-sysv\ 44 cc2-qbe_arm64-sysv\ 45 cc2-z80-scc\ 46 47 all: 48 +@$(MAKE) $(DIRS) 49 +@$(MAKE) $(TARGET) 50 @cp $(TARGET) $(LIBEXEC)/scc 51 52 main.o: error.h 53 qbe_amd64-sysv qbe_arm64-sysv: qbe 54 qbe_amd64-sysv: amd64-sysv 55 qbe_arm64-sysv: arm64-sysv 56 57 error.h: cc2.h 58 rm -f $@;\ 59 trap 'rm -f $$$$.h' EXIT INT QUIT TERM HUP;\ 60 awk -f generror.awk cc2.h > $$$$.h && mv $$$$.h $@ 61 62 cc2-qbe_amd64-sysv: $(LIBSCC) $(QBE_AMD64_SYSV_OBJS) 63 $(CC) $(PROJ_LDFLAGS) $(QBE_AMD64_SYSV_OBJS) $(PROJ_LDLIBS) -o $@ 64 65 cc2-qbe_arm64-sysv: $(LIBSCC) $(QBE_ARM64_SYSV_OBJS) 66 $(CC) $(PROJ_LDFLAGS) $(QBE_ARM64_SYSV_OBJS) $(PROJ_LDLIBS) -o $@ 67 68 cc2-z80-scc: $(LIBSCC) $(Z80_SCC_OBJS) 69 $(CC) $(PROJ_LDFLAGS) $(Z80_SCC_OBJS) $(PROJ_LDLIBS) -o $@ 70 71 clean: 72 rm -f error.h