Changeset 2628642 in mainline
- Timestamp:
- 2017-05-18T18:04:13Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b06414f
- Parents:
- 3ec2acc
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/mkarray.py
r3ec2acc r2628642 37 37 def usage(prname): 38 38 "Print usage syntax" 39 print("%s <DESTINATION> <LABEL> [SOURCE ...]" % prname)39 print("%s <DESTINATION> <LABEL> <AS_PROLOG> [SOURCE ...]" % prname) 40 40 41 41 def main(): 42 if (len(sys.argv) < 3):42 if (len(sys.argv) < 4): 43 43 usage(sys.argv[0]) 44 44 return … … 46 46 dest = sys.argv[1] 47 47 label = sys.argv[2] 48 as_prolog = sys.argv[3] 48 49 49 50 header_ctx = [] 50 51 data_ctx = [] 51 for src in sys.argv[3:]: 52 53 for src in sys.argv[4:]: 52 54 basename = os.path.basename(src) 53 55 symbol = basename.replace(".", "_") … … 59 61 src_in.close() 60 62 61 header_rec = "extern uint8_t %s[];" % symbol 62 header_ctx.append(header_rec) 63 64 data_rec = "uint8_t %s[] = {\n\t" % symbol 63 data_rec = "\t.byte " 65 64 66 65 fmt = 'B' … … 74 73 if (offset > 0): 75 74 if ((cnt % 15) == 0): 76 data_rec += " ,\n\t"75 data_rec += "\n\t.byte " 77 76 else: 78 77 data_rec += ", " … … 82 81 cnt += 1 83 82 84 data_rec += "\n};\n" 85 data_ctx.append(data_rec) 83 data_rec += "\n" 86 84 87 header_ rec = "extern size_t %s_size;" % symbol88 header_ctx.append( header_rec)85 header_ctx.append("extern uint64_t %s_size;" % symbol) 86 header_ctx.append("extern uint8_t %s[];" % symbol) 89 87 90 data_rec = "size_t %s_size = %u;\n" % (symbol, offset) 88 data_ctx.append(".globl %s_size" % symbol) 89 data_ctx.append(".balign 8"); 90 data_ctx.append(".size %s_size, 8" % symbol) 91 data_ctx.append("%s_size:" % symbol) 92 data_ctx.append("\t.quad %u\n" % offset) 93 94 data_ctx.append(".globl %s" % symbol) 95 data_ctx.append(".balign 8") 96 data_ctx.append(".size %s, %u" % (symbol, offset)) 97 data_ctx.append("%s:" % symbol) 91 98 data_ctx.append(data_rec) 92 99 … … 107 114 header.close() 108 115 109 data = open("%s. c" % dest, "w")116 data = open("%s.s" % dest, "w") 110 117 111 118 data.write('/***************************************\n') … … 113 120 data.write(' * Generated by: tools/mkarray.py *\n') 114 121 data.write(' ***************************************/\n\n') 115 data.write("#include \"%s.h\"\n\n" % dest) 122 data.write(as_prolog) 123 data.write('.data\n\n') 116 124 data.write("\n".join(data_ctx)) 117 125 -
uspace/app/barber/Makefile
r3ec2acc r2628642 46 46 SOURCES = \ 47 47 barber.c \ 48 images. c48 images.s 49 49 50 50 IMAGES = \ … … 80 80 gfx/frame30.tga.gz 81 81 82 PRE_DEPEND = images. cimages.h83 EXTRA_CLEAN = images. cimages.h82 PRE_DEPEND = images.s images.h 83 EXTRA_CLEAN = images.s images.h 84 84 85 85 include $(USPACE_PREFIX)/Makefile.common 86 86 87 image %.c image%.h: $(IMAGES)88 $(ROOT_PATH)/tools/mkarray.py images COMPOSITOR_IMAGES $(IMAGES)87 images.s images.h: $(IMAGES) 88 $(ROOT_PATH)/tools/mkarray.py images COMPOSITOR_IMAGES "$(AS_PROLOG)" $^ -
uspace/app/vlaunch/Makefile
r3ec2acc r2628642 45 45 SOURCES = \ 46 46 vlaunch.c \ 47 images. c47 images.s 48 48 49 49 IMAGES = \ 50 50 gfx/helenos.tga 51 51 52 PRE_DEPEND = images. cimages.h53 EXTRA_CLEAN = images. cimages.h52 PRE_DEPEND = images.s images.h 53 EXTRA_CLEAN = images.s images.h 54 54 55 55 include $(USPACE_PREFIX)/Makefile.common 56 56 57 images. cimages.h: $(IMAGES)58 $(ROOT_PATH)/tools/mkarray.py images COMPOSITOR_IMAGES $^57 images.s images.h: $(IMAGES) 58 $(ROOT_PATH)/tools/mkarray.py images COMPOSITOR_IMAGES "$(AS_PROLOG)" $^ -
uspace/lib/c/arch/mips32/Makefile.common
r3ec2acc r2628642 29 29 GCC_CFLAGS += -msoft-float -mabi=32 30 30 BASE_LIBS += $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a 31 AS_PROLOG = .module softfloat;.abicalls; 31 32 32 33 ENDIANESS = LE -
uspace/lib/c/arch/mips32eb/Makefile.common
r3ec2acc r2628642 29 29 GCC_CFLAGS += -msoft-float -mabi=32 30 30 BASE_LIBS += $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a 31 AS_PROLOG = .module softfloat;.abicalls; 31 32 32 33 ENDIANESS = BE
Note:
See TracChangeset
for help on using the changeset viewer.