Makefrag (1156B)
1 ifeq ($(ARCH),x86_64) 2 VX32_RUN = run64.o 3 else 4 ifeq ($(ARCH),amd64) 5 VX32_RUN = run64.o 6 else 7 VX32_RUN = run32.o 8 endif 9 endif 10 11 ifeq ($(OS),darwin) 12 VX32_RUN = run32.o 13 VX32_RUN := $(VX32_RUN) darwin-asm.o 14 endif 15 16 ifeq ($(OS),linux) 17 VX32_RUN := $(VX32_RUN) linux-asm.o 18 endif 19 20 VX32_OBJS = \ 21 $(addprefix libvx32/, \ 22 chunk.o \ 23 elf.o \ 24 emu.o \ 25 mem.o \ 26 proc.o \ 27 rts.o \ 28 sig.o \ 29 x86dis.o \ 30 $(OS).o \ 31 $(VX32_RUN) \ 32 ) 33 34 VX32_DEPS := libvx32/libvx32.a 35 VX32_INST := $(prefix)/lib/libvx32.a 36 37 CLEAN_FILES += $(VX32_OBJS) $(VX32_DEPS) libvx32/asm.h 38 39 all: $(VX32_DEPS) 40 install: $(VX32_INST) 41 42 libvx32/rts.o: libvx32/asm.h 43 44 libvx32/%.o: libvx32/%.c 45 $(HOST_CC) -Ilibvx32 -c $(HOST_CFLAGS) -o $@ $< 46 47 libvx32/%.o: libvx32/%.S 48 $(HOST_CC) -Ilibvx32 -c $(HOST_CFLAGS) -o $@ $< 49 50 libvx32/asm.h: libvx32/asm.sym libvx32/gensym.awk libvx32/vx32impl.h 51 awk -f libvx32/gensym.awk libvx32/asm.sym >libvx32/asm-sym.c 52 $(HOST_CC) $(HOST_CFLAGS) -S -o libvx32/asm-sym.s libvx32/asm-sym.c 53 grep mAgIc libvx32/asm-sym.s | sed -e 's/mAgIc[^0-9]*//g' >$@ 54 55 libvx32/libvx32.a: $(VX32_OBJS) 56 $(AR) rs $@ $(VX32_OBJS) 57 58 $(prefix)/lib/libvx32.a: libvx32/libvx32.a 59 $(INSTALL) $< $@