From 2c4a6af07be2321ab3b555436f5febd54ad924b0 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Tue, 23 Nov 2021 17:43:37 +0000 Subject: [PATCH] - refactored common sources into common git-svn-id: http://moon:8086/svn/mips@197 a8ebac50-d88d-4704-bea3-6648445a41b3 --- make/mips_app.mk | 2 +- src/Makefile | 964 ++++++++++++++-------------- src/{ => common}/jman/bintree.c | 2 +- src/{ => common}/jman/bintree.h | 6 +- src/{ => common}/jman/camset.c | 4 +- src/{ => common}/jman/camset.h | 8 +- src/{ => common}/jman/colortypes.h | 6 +- src/{ => common}/jman/engine.c | 20 +- src/{ => common}/jman/engine.h | 13 +- src/{ => common}/jman/graph_state.c | 16 +- src/{ => common}/jman/graph_state.h | 10 +- src/{ => common}/jman/grid.c | 16 +- src/{ => common}/jman/grid.h | 7 +- src/{ => common}/jman/imageio.c | 7 +- src/{ => common}/jman/imageio.h | 13 +- src/{ => common}/jman/linklist.c | 2 +- src/{ => common}/jman/linklist.h | 9 +- src/{ => common}/jman/matrix.c | 5 +- src/{ => common}/jman/matrix.h | 10 +- src/{ => common}/jman/object.c | 18 +- src/{ => common}/jman/object.h | 16 +- src/{ => common}/jman/patches.c | 4 +- src/{ => common}/jman/patches.h | 8 +- src/{ => common}/jman/patches2.c | 4 +- src/{ => common}/jman/polys.c | 4 +- src/{ => common}/jman/polys.h | 7 +- src/{ => common}/jman/render.c | 14 +- src/{ => common}/jman/render.h | 29 +- src/{ => common}/jman/ri.c | 20 +- src/{ => common}/jman/ri.h | 6 +- src/{ => common}/jman/ribgen.c | 16 +- src/{ => common}/jman/ribgen.h | 6 +- src/{ => common}/jman/stack.c | 3 +- src/{ => common}/jman/stack.h | 8 +- src/{ => common}/jman/types.h | 6 +- src/{ => common}/jman/vars.c | 19 +- src/{ => common}/jman/vars.h | 8 +- src/{jman => }/main_patches.c | 10 +- src/{jman => }/main_patchmeshes.c | 6 +- src/{jman => }/main_polypin.c | 6 +- 40 files changed, 669 insertions(+), 669 deletions(-) rename src/{ => common}/jman/bintree.c (94%) rename src/{ => common}/jman/bintree.h (91%) rename src/{ => common}/jman/camset.c (95%) rename src/{ => common}/jman/camset.h (75%) rename src/{ => common}/jman/colortypes.h (88%) rename src/{ => common}/jman/engine.c (93%) rename src/{ => common}/jman/engine.h (84%) rename src/{ => common}/jman/graph_state.c (89%) rename src/{ => common}/jman/graph_state.h (87%) rename src/{ => common}/jman/grid.c (93%) rename src/{ => common}/jman/grid.h (85%) rename src/{ => common}/jman/imageio.c (90%) rename src/{ => common}/jman/imageio.h (79%) rename src/{ => common}/jman/linklist.c (93%) rename src/{ => common}/jman/linklist.h (86%) rename src/{ => common}/jman/matrix.c (95%) rename src/{ => common}/jman/matrix.h (88%) rename src/{ => common}/jman/object.c (94%) rename src/{ => common}/jman/object.h (90%) rename src/{ => common}/jman/patches.c (94%) rename src/{ => common}/jman/patches.h (72%) rename src/{ => common}/jman/patches2.c (94%) rename src/{ => common}/jman/polys.c (95%) rename src/{ => common}/jman/polys.h (84%) rename src/{ => common}/jman/render.c (95%) rename src/{ => common}/jman/render.h (59%) rename src/{ => common}/jman/ri.c (94%) rename src/{ => common}/jman/ri.h (97%) rename src/{ => common}/jman/ribgen.c (94%) rename src/{ => common}/jman/ribgen.h (96%) rename src/{ => common}/jman/stack.c (90%) rename src/{ => common}/jman/stack.h (74%) rename src/{ => common}/jman/types.h (82%) rename src/{ => common}/jman/vars.c (91%) rename src/{ => common}/jman/vars.h (85%) rename src/{jman => }/main_patches.c (95%) rename src/{jman => }/main_patchmeshes.c (93%) rename src/{jman => }/main_polypin.c (94%) diff --git a/make/mips_app.mk b/make/mips_app.mk index af0b543..e8524b9 100644 --- a/make/mips_app.mk +++ b/make/mips_app.mk @@ -14,7 +14,7 @@ BUILD_DIR=build/$(BOARD)/$(ENDIANESS) LSYS_BUILD_DIR=libsys/build/$(BOARD)/$(ENDIANESS) CFLAGS += -Wl,--gc-sections -G 0 -T $(MIPS_HOME)/link/ram.ld -CFLAGS += -I. -Ilibsys -Ilibsys/boards/$(BOARD) -L$(LSYS_BUILD_DIR) $(DEFINES) +CFLAGS += -I. -Icommon -Ilibsys -Ilibsys/boards/$(BOARD) -L$(LSYS_BUILD_DIR) $(DEFINES) CFLAGS += -Wl,-M LIBS=-lsys -lm -lc diff --git a/src/Makefile b/src/Makefile index 72696b5..1344161 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,482 +1,482 @@ -ENDIANESS ?=eb -BOARD ?=ml402 - -include ../make/mips_app.mk - -PROG-ml402 = $(addprefix $(BUILD_DIR)/, hello.elf testbench.elf test_irq.elf dhry.elf queens.elf stanford.elf paranoia.elf rmd160_test.elf Bessel.elf whet.elf phrasen.elf dttl.elf richards_benchmark.elf test_exception.elf life.elf r3.elf gunzip.elf basic_math.elf jman_patches.elf jman_patchmeshes.elf jman_polys.elf test_hpi.elf test_vga.elf test_fft.elf flashtest.elf) -PROG-denano = $(addprefix $(BUILD_DIR)/, hello.elf dhry.elf queens.elf stanford.elf paranoia.elf rmd160_test.elf Bessel.elf whet.elf phrasen.elf dttl.elf richards_benchmark.elf test_exception.elf testbench_denano.elf) -PROG-sim = $(addprefix $(BUILD_DIR)/, hello.elf test_exception_sim.elf) - -all: $(PROG-$(BOARD)) - -$(BUILD_DIR): - mkdir -p $(BUILD_DIR) - -$(BUILD_DIR)/flashtest.elf: $(BUILD_DIR) flashtest.c - $(CC) $(CFLAGS) -o $@ -O2 flashtest.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/test_fft.elf: $(BUILD_DIR) test_fft.c - $(CC) $(CFLAGS) -o $@ -O2 fft.c test_fft.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/hello.elf: $(BUILD_DIR) hello.c - $(CC) $(CFLAGS) -o $@ hello.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/ICacheTest.elf: $(BUILD_DIR) ICacheTest.c - $(CC) -O0 $(CFLAGS) -o $@ ICacheTest.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/blittertest.elf: $(BUILD_DIR) blittertest.c - $(CC) $(CFLAGS) -o $@ -Os blittertest.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/blittertest_tb.elf: $(BUILD_DIR) blittertest_tb.c - $(CC) $(CFLAGS) -o $@ -Os blittertest_tb.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/testbench.elf: $(BUILD_DIR) testbench.c - $(CC) $(CFLAGS) -O3 -o $@ -DHZ=1000 -DNOSIGNAL -DBATCHMODE -DNOMAIN -Os -g testbench.c paranoia.c delay_mips.c bogomips.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/testbench_denano.elf: $(BUILD_DIR) testbench_denano.c - $(CC) $(CFLAGS) -O3 -o $@ -DHZ=1000 -DNOSIGNAL -DBATCHMODE -DNOMAIN -Os -g testbench_denano.c paranoia.c delay_mips.c bogomips.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/test_irq.elf: $(BUILD_DIR) test_irq.c - $(CC) $(CFLAGS) -o $@ test_irq.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/dhry.elf: $(BUILD_DIR) dhry_1.c dhry_2.c dhry.h - $(CC) $(CFLAGS) -O3 -o $@ -DHZ=1000 dhry_1.c dhry_2.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/queens.elf: $(BUILD_DIR) queens.c - $(CC) $(CFLAGS) -o $@ -DUNIX_Old -DHZ=1000 queens.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/stanford.elf: $(BUILD_DIR) stanford.c - $(CC) $(CFLAGS) -O3 -o $@ -DHZ=1000 stanford.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/paranoia.elf: $(BUILD_DIR) paranoia.c - $(CC) $(CFLAGS) -O3 -o $@ -DNOSIGNAL -DBATCHMODE paranoia.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/rmd160_test.elf: rmd160_test.c rmd160.c rmd160.h - $(CC) $(CFLAGS) -O3 -o $@ rmd160_test.c rmd160.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/hashtest.elf: $(BUILD_DIR) hashtest.c rmd160.c rmd160.h - $(CC) $(CFLAGS) -O3 -o $@ hashtest.c rmd160.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/Bessel.elf: $(BUILD_DIR) Bessel.c - $(CC) $(CFLAGS) -o $@ Bessel.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/whet.elf: $(BUILD_DIR) whet.c - $(CC) $(CFLAGS) -o $@ whet.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/phrasen.elf: $(BUILD_DIR) phrasen.c - $(CC) $(CFLAGS) -o $@ phrasen.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/dttl.elf: $(BUILD_DIR) dttl.c random.c - $(CC) $(CFLAGS) -o $@ dttl.c random.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/richards_benchmark.elf: $(BUILD_DIR) richards_benchmark.c - $(CC) $(CFLAGS) -o $@ richards_benchmark.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/test_exception.elf: $(BUILD_DIR) test_exception.c - $(CC) $(CFLAGS) -o $@ -O1 test_exception.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/life.elf: $(BUILD_DIR) life.c - $(CC) $(CFLAGS) -o $@ -g life.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/r3.elf: $(BUILD_DIR) r3.c - $(CC) $(CFLAGS) -O3 -o $@ -DJMIPS_VGA -O2 r3.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/gunzip.elf: $(BUILD_DIR) gunzip.c inflate.c crc32.c $(LSYS_BUILD_DIR)/libsys.a - $(CC) $(CFLAGS) -o $@ -o $@ gunzip.c inflate.c crc32.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/basic_math.elf: $(BUILD_DIR) basicmath_small.c rad2deg.c cubic.c isqrt.c - $(CC) $(CFLAGS) -o $@ -o $@ basicmath_small.c rad2deg.c cubic.c isqrt.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -JMAN_SRC= \ - jman/bintree.c \ - jman/camset.c \ - jman/engine.c \ - jman/graph_state.c \ - jman/grid.c \ - jman/imageio.c \ - jman/linklist.c \ - jman/matrix.c \ - jman/object.c \ - jman/render.c \ - jman/ri.c \ - jman/ribgen.c \ - jman/stack.c \ - jman/vars.c - -$(BUILD_DIR)/jman_patches.elf: $(BUILD_DIR) $(JMAN_SRC) jman/main_patches.c - $(CC) $(CFLAGS) -I../ -o $@ -o $@ jman/main_patches.c $(JMAN_SRC) $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/jman_patchmeshes.elf: $(BUILD_DIR) $(JMAN_SRC) jman/main_patchmeshes.c jman/patches2.c - $(CC) $(CFLAGS) -I../ -o $@ -o $@ jman/main_patchmeshes.c jman/patches2.c $(JMAN_SRC) $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/jman_polys.elf: $(BUILD_DIR) $(JMAN_SRC) jman/main_polypin.c jman/polys.c - $(CC) $(CFLAGS) -I../ -o $@ -o $@ jman/main_polypin.c jman/polys.c $(JMAN_SRC) $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/serdump.elf: $(BUILD_DIR) serdump.c - $(CC) $(CFLAGS) -O3 -o $@ -O2 serdump.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/pppi.elf: $(BUILD_DIR) pppissue/test1.c pppissue/utils.c pppissue/pppd.h - $(CC) $(CFLAGS) -O2 -o $@ -O2 pppissue/test1.c pppissue/utils.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/lwl.elf: $(BUILD_DIR) lwl.c - $(CC) $(CFLAGS) -O2 -o $@ lwl.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/ucb.elf: $(BUILD_DIR) ucb.c - $(CC) $(CFLAGS) -O2 -o $@ ucb.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/test_timer.elf: $(BUILD_DIR) test_timer.c - $(CC) $(CFLAGS) -O2 -o $@ test_timer.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/test_exception_sim.elf: $(BUILD_DIR) test_exception_sim.c - $(CC) $(CFLAGS) -o $@ test_exception_sim.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/test_tlb_sim.elf: $(BUILD_DIR) test_tlb_sim.c - $(CC) $(CFLAGS) -O2 -o $@ test_tlb_sim.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/test_dcache_sim.elf: $(BUILD_DIR) test_dcache.c - $(CC) $(CFLAGS) -O0 -o $@ test_dcache.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/test_hpi.elf: $(BUILD_DIR) hpi.c test_hpi.c cfiflash.c - $(CC) $(CFLAGS) -o $@ -g hpi.c test_hpi.c cfiflash.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/test_vga.elf: $(BUILD_DIR) test_vga.c - $(CC) $(CFLAGS) -o $@ test_vga.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/barcode.elf: $(BUILD_DIR) barcode.c - $(CC) $(CFLAGS) -o $@ barcode.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/lua.elf: $(BUILD_DIR) lua_init.c - $(CC) $(CFLAGS) -I./lua-5.1.4/etc -I./lua-5.1.4/src -o $@ lua_init.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/mandelbrot.elf: $(BUILD_DIR) mandelbrot.c - $(CC) $(CFLAGS) -o $@ mandelbrot.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/bogomips.elf: $(BUILD_DIR) bogomips.c delay_mips.c - $(CC) $(CFLAGS) -DHZ=1000 -o $@ bogomips.c delay_mips.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/test_asm.elf: $(BUILD_DIR) test_asm.S - $(CC) $(CFLAGS) -DHZ=1000 -o $@ test_asm.S $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/test_ac97.elf: $(BUILD_DIR) test_ac97.c - $(CC) $(CFLAGS) -o $@ test_ac97.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/aes256_1.elf: $(BUILD_DIR) aes256_1.c aes256.c aes256.h - $(CC) $(CFLAGS) -O3 -o $@ aes256_1.c aes256.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/test_gpio.elf: $(BUILD_DIR) test_gpio.c marvell_88e1111.c mii-bitbang.c emac.c emac.h ethernet.c ethernet.h arp.c arp.h icmp.c icmp.h ipv4.c ipv4.h udp.c udp.h dhcp.c dhcp.h fifo.c fifo.h - $(CC) $(CFLAGS) -o $@ -O2 test_gpio.c marvell_88e1111.c mii-bitbang.c emac.c ethernet.c arp.c icmp.c ipv4.c udp.c dhcp.c fifo.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/test_emac_sim.elf: $(BUILD_DIR) test_emac_sim.c emac.c emac.h - $(CC) $(CFLAGS) -o $@ -Os test_emac_sim.c emac.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/mips_io.elf: $(BUILD_DIR) mips_io.c - $(CC) $(CFLAGS) -o $@ mips_io.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/mips_instr.elf: $(BUILD_DIR) mips_instr.c - $(CC) $(CFLAGS) -o $@ mips_instr.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -$(BUILD_DIR)/test_endianess.elf: $(BUILD_DIR) test_endianess.c - $(CC) $(CFLAGS) -O0 -o $@ test_endianess.c $(LIBS) >$@.map - $(OBJDUMP) -d $@ > $@.dis - $(OBJCOPY) $@ -O binary $@.bin - $(OBJCOPY) -O srec $@ $@.srec - $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) - cat $@.srec | $(PACKHEX) > $@.pack - $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex - -clean: - rm -rf $(BUILD_DIR)/*.bin $(BUILD_DIR)/*.map $(BUILD_DIR)/*.dis $(BUILD_DIR)/*.srec $(BUILD_DIR)/*.pack $(BUILD_DIR)/*.elf $(BUILD_DIR)/*.hex $(PROG) > /dev/null +ENDIANESS ?=eb +BOARD ?=ml402 + +include ../make/mips_app.mk + +PROG-ml402 = $(addprefix $(BUILD_DIR)/, hello.elf testbench.elf test_irq.elf dhry.elf queens.elf stanford.elf paranoia.elf rmd160_test.elf Bessel.elf whet.elf phrasen.elf dttl.elf richards_benchmark.elf test_exception.elf life.elf r3.elf gunzip.elf basic_math.elf jman_patches.elf jman_patchmeshes.elf jman_polys.elf test_hpi.elf test_vga.elf test_fft.elf flashtest.elf) +PROG-denano = $(addprefix $(BUILD_DIR)/, hello.elf dhry.elf queens.elf stanford.elf paranoia.elf rmd160_test.elf Bessel.elf whet.elf phrasen.elf dttl.elf richards_benchmark.elf test_exception.elf testbench_denano.elf) +PROG-sim = $(addprefix $(BUILD_DIR)/, hello.elf test_exception_sim.elf) + +all: $(PROG-$(BOARD)) + +$(BUILD_DIR): + mkdir -p $(BUILD_DIR) + +$(BUILD_DIR)/flashtest.elf: $(BUILD_DIR) flashtest.c + $(CC) $(CFLAGS) -o $@ -O2 flashtest.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/test_fft.elf: $(BUILD_DIR) test_fft.c + $(CC) $(CFLAGS) -o $@ -O2 fft.c test_fft.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/hello.elf: $(BUILD_DIR) hello.c + $(CC) $(CFLAGS) -o $@ hello.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/ICacheTest.elf: $(BUILD_DIR) ICacheTest.c + $(CC) -O0 $(CFLAGS) -o $@ ICacheTest.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/blittertest.elf: $(BUILD_DIR) blittertest.c + $(CC) $(CFLAGS) -o $@ -Os blittertest.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/blittertest_tb.elf: $(BUILD_DIR) blittertest_tb.c + $(CC) $(CFLAGS) -o $@ -Os blittertest_tb.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/testbench.elf: $(BUILD_DIR) testbench.c + $(CC) $(CFLAGS) -O3 -o $@ -DHZ=1000 -DNOSIGNAL -DBATCHMODE -DNOMAIN -Os -g testbench.c paranoia.c delay_mips.c bogomips.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/testbench_denano.elf: $(BUILD_DIR) testbench_denano.c + $(CC) $(CFLAGS) -O3 -o $@ -DHZ=1000 -DNOSIGNAL -DBATCHMODE -DNOMAIN -Os -g testbench_denano.c paranoia.c delay_mips.c bogomips.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/test_irq.elf: $(BUILD_DIR) test_irq.c + $(CC) $(CFLAGS) -o $@ test_irq.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/dhry.elf: $(BUILD_DIR) dhry_1.c dhry_2.c dhry.h + $(CC) $(CFLAGS) -O3 -o $@ -DHZ=1000 dhry_1.c dhry_2.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/queens.elf: $(BUILD_DIR) queens.c + $(CC) $(CFLAGS) -o $@ -DUNIX_Old -DHZ=1000 queens.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/stanford.elf: $(BUILD_DIR) stanford.c + $(CC) $(CFLAGS) -O3 -o $@ -DHZ=1000 stanford.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/paranoia.elf: $(BUILD_DIR) paranoia.c + $(CC) $(CFLAGS) -O3 -o $@ -DNOSIGNAL -DBATCHMODE paranoia.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/rmd160_test.elf: rmd160_test.c rmd160.c rmd160.h + $(CC) $(CFLAGS) -O3 -o $@ rmd160_test.c rmd160.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/hashtest.elf: $(BUILD_DIR) hashtest.c rmd160.c rmd160.h + $(CC) $(CFLAGS) -O3 -o $@ hashtest.c rmd160.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/Bessel.elf: $(BUILD_DIR) Bessel.c + $(CC) $(CFLAGS) -o $@ Bessel.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/whet.elf: $(BUILD_DIR) whet.c + $(CC) $(CFLAGS) -o $@ whet.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/phrasen.elf: $(BUILD_DIR) phrasen.c + $(CC) $(CFLAGS) -o $@ phrasen.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/dttl.elf: $(BUILD_DIR) dttl.c random.c + $(CC) $(CFLAGS) -o $@ dttl.c random.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/richards_benchmark.elf: $(BUILD_DIR) richards_benchmark.c + $(CC) $(CFLAGS) -o $@ richards_benchmark.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/test_exception.elf: $(BUILD_DIR) test_exception.c + $(CC) $(CFLAGS) -o $@ -O1 test_exception.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/life.elf: $(BUILD_DIR) life.c + $(CC) $(CFLAGS) -o $@ -g life.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/r3.elf: $(BUILD_DIR) r3.c + $(CC) $(CFLAGS) -O3 -o $@ -DJMIPS_VGA -O2 r3.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/gunzip.elf: $(BUILD_DIR) gunzip.c inflate.c crc32.c $(LSYS_BUILD_DIR)/libsys.a + $(CC) $(CFLAGS) -o $@ -o $@ gunzip.c inflate.c crc32.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/basic_math.elf: $(BUILD_DIR) basicmath_small.c rad2deg.c cubic.c isqrt.c + $(CC) $(CFLAGS) -o $@ -o $@ basicmath_small.c rad2deg.c cubic.c isqrt.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +JMAN_SRC= \ + common/jman/bintree.c \ + common/jman/camset.c \ + common/jman/engine.c \ + common/jman/graph_state.c \ + common/jman/grid.c \ + common/jman/imageio.c \ + common/jman/linklist.c \ + common/jman/matrix.c \ + common/jman/object.c \ + common/jman/render.c \ + common/jman/ri.c \ + common/jman/ribgen.c \ + common/jman/stack.c \ + common/jman/vars.c + +$(BUILD_DIR)/jman_patches.elf: $(BUILD_DIR) $(JMAN_SRC) main_patches.c + $(CC) $(CFLAGS) -I../ -o $@ -o $@ main_patches.c $(JMAN_SRC) $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/jman_patchmeshes.elf: $(BUILD_DIR) $(JMAN_SRC) main_patchmeshes.c common/jman/patches2.c + $(CC) $(CFLAGS) -I../ -o $@ -o $@ main_patchmeshes.c common/jman/patches2.c $(JMAN_SRC) $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/jman_polys.elf: $(BUILD_DIR) $(JMAN_SRC) main_polypin.c common/jman/polys.c + $(CC) $(CFLAGS) -I../ -o $@ -o $@ main_polypin.c common/jman/polys.c $(JMAN_SRC) $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/serdump.elf: $(BUILD_DIR) serdump.c + $(CC) $(CFLAGS) -O3 -o $@ -O2 serdump.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/pppi.elf: $(BUILD_DIR) pppissue/test1.c pppissue/utils.c pppissue/pppd.h + $(CC) $(CFLAGS) -O2 -o $@ -O2 pppissue/test1.c pppissue/utils.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/lwl.elf: $(BUILD_DIR) lwl.c + $(CC) $(CFLAGS) -O2 -o $@ lwl.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/ucb.elf: $(BUILD_DIR) ucb.c + $(CC) $(CFLAGS) -O2 -o $@ ucb.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/test_timer.elf: $(BUILD_DIR) test_timer.c + $(CC) $(CFLAGS) -O2 -o $@ test_timer.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/test_exception_sim.elf: $(BUILD_DIR) test_exception_sim.c + $(CC) $(CFLAGS) -o $@ test_exception_sim.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/test_tlb_sim.elf: $(BUILD_DIR) test_tlb_sim.c + $(CC) $(CFLAGS) -O2 -o $@ test_tlb_sim.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/test_dcache_sim.elf: $(BUILD_DIR) test_dcache.c + $(CC) $(CFLAGS) -O0 -o $@ test_dcache.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/test_hpi.elf: $(BUILD_DIR) hpi.c test_hpi.c cfiflash.c + $(CC) $(CFLAGS) -o $@ -g hpi.c test_hpi.c cfiflash.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/test_vga.elf: $(BUILD_DIR) test_vga.c + $(CC) $(CFLAGS) -o $@ test_vga.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/barcode.elf: $(BUILD_DIR) barcode.c + $(CC) $(CFLAGS) -o $@ barcode.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/lua.elf: $(BUILD_DIR) lua_init.c + $(CC) $(CFLAGS) -I./lua-5.1.4/etc -I./lua-5.1.4/src -o $@ lua_init.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/mandelbrot.elf: $(BUILD_DIR) mandelbrot.c + $(CC) $(CFLAGS) -o $@ mandelbrot.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/bogomips.elf: $(BUILD_DIR) bogomips.c delay_mips.c + $(CC) $(CFLAGS) -DHZ=1000 -o $@ bogomips.c delay_mips.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/test_asm.elf: $(BUILD_DIR) test_asm.S + $(CC) $(CFLAGS) -DHZ=1000 -o $@ test_asm.S $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/test_ac97.elf: $(BUILD_DIR) test_ac97.c + $(CC) $(CFLAGS) -o $@ test_ac97.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/aes256_1.elf: $(BUILD_DIR) aes256_1.c aes256.c aes256.h + $(CC) $(CFLAGS) -O3 -o $@ aes256_1.c aes256.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/test_gpio.elf: $(BUILD_DIR) test_gpio.c marvell_88e1111.c mii-bitbang.c emac.c emac.h ethernet.c ethernet.h arp.c arp.h icmp.c icmp.h ipv4.c ipv4.h udp.c udp.h dhcp.c dhcp.h fifo.c fifo.h + $(CC) $(CFLAGS) -o $@ -O2 test_gpio.c marvell_88e1111.c mii-bitbang.c emac.c ethernet.c arp.c icmp.c ipv4.c udp.c dhcp.c fifo.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/test_emac_sim.elf: $(BUILD_DIR) test_emac_sim.c emac.c emac.h + $(CC) $(CFLAGS) -o $@ -Os test_emac_sim.c emac.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/mips_io.elf: $(BUILD_DIR) mips_io.c + $(CC) $(CFLAGS) -o $@ mips_io.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/mips_instr.elf: $(BUILD_DIR) mips_instr.c + $(CC) $(CFLAGS) -o $@ mips_instr.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +$(BUILD_DIR)/test_endianess.elf: $(BUILD_DIR) test_endianess.c + $(CC) $(CFLAGS) -O0 -o $@ test_endianess.c $(LIBS) >$@.map + $(OBJDUMP) -d $@ > $@.dis + $(OBJCOPY) $@ -O binary $@.bin + $(OBJCOPY) -O srec $@ $@.srec + $(FLASHGEN) $@.bin $(ENDIAN_FLAGS) + cat $@.srec | $(PACKHEX) > $@.pack + $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex + +clean: + rm -rf $(BUILD_DIR)/*.bin $(BUILD_DIR)/*.map $(BUILD_DIR)/*.dis $(BUILD_DIR)/*.srec $(BUILD_DIR)/*.pack $(BUILD_DIR)/*.elf $(BUILD_DIR)/*.hex $(PROG) > /dev/null diff --git a/src/jman/bintree.c b/src/common/jman/bintree.c similarity index 94% rename from src/jman/bintree.c rename to src/common/jman/bintree.c index 4908515..b940e23 100644 --- a/src/jman/bintree.c +++ b/src/common/jman/bintree.c @@ -7,7 +7,7 @@ #include #include #include -#include "bintree.h" +#include // ------------------------------------------------------------ node_t* GetParent(node_t *pObj) diff --git a/src/jman/bintree.h b/src/common/jman/bintree.h similarity index 91% rename from src/jman/bintree.h rename to src/common/jman/bintree.h index 6e1c40a..9c48df7 100644 --- a/src/jman/bintree.h +++ b/src/common/jman/bintree.h @@ -4,8 +4,8 @@ // // 27.02.2005, J.Ahrensfeld // ------------------------------------------------------------ -#ifndef BINTREE_H -#define BINTREE_H +#ifndef JMAN_BINTREE_H +#define JMAN_BINTREE_H // ------------------------------------------------------------ typedef struct _node_t @@ -39,4 +39,4 @@ int bintree_destroy(node_t *pObj); // ------------------------------------------------------------ -#endif // BINTREE_H +#endif // JMAN_BINTREE_H diff --git a/src/jman/camset.c b/src/common/jman/camset.c similarity index 95% rename from src/jman/camset.c rename to src/common/jman/camset.c index 68eee7e..518fa24 100644 --- a/src/jman/camset.c +++ b/src/common/jman/camset.c @@ -1,6 +1,6 @@ #include -#include "ri.h" -#include "camset.h" +#include +#include #define min(a,b) ((a)<(b)?(a):(b)) #define PI 3.1415926535897932384626433832795 diff --git a/src/jman/camset.h b/src/common/jman/camset.h similarity index 75% rename from src/jman/camset.h rename to src/common/jman/camset.h index 86530d8..4adf1f8 100644 --- a/src/jman/camset.h +++ b/src/common/jman/camset.h @@ -1,11 +1,9 @@ -#ifndef CAMSET_H -#define CAMSET_H - -//#include "ri.h" +#ifndef JMAN_CAMSET_H +#define JMAN_CAMSET_H void PlaceCamera(RtPoint position, RtPoint direction, float roll); void AimZ(RtPoint direction); void FrameCamera(float focallength, float framewidth, float frameheight); void FrameCamera2(float focallength, float framewidth, float frameheight); -#endif // CAMSET_H \ No newline at end of file +#endif // JMAN_CAMSET_H \ No newline at end of file diff --git a/src/jman/colortypes.h b/src/common/jman/colortypes.h similarity index 88% rename from src/jman/colortypes.h rename to src/common/jman/colortypes.h index 995daad..a78627b 100644 --- a/src/jman/colortypes.h +++ b/src/common/jman/colortypes.h @@ -5,8 +5,8 @@ // // 12.03.2005, J.Ahrensfeld // ------------------------------------------------------------ -#ifndef COLORTYPES_H -#define COLORTYPES_H +#ifndef JMAN_COLORTYPES_H +#define JMAN_COLORTYPES_H // ------------------------------------------------------------ #define COMP_RED 0 @@ -33,4 +33,4 @@ typedef rgba_t rgba_matrix_t[4]; // ------------------------------------------------------------ -#endif // COLORTYPES_H +#endif // JMAN_COLORTYPES_H diff --git a/src/jman/engine.c b/src/common/jman/engine.c similarity index 93% rename from src/jman/engine.c rename to src/common/jman/engine.c index b285a60..fdb385c 100644 --- a/src/jman/engine.c +++ b/src/common/jman/engine.c @@ -3,18 +3,14 @@ #include #include #include -#include "ri.h" -#include "types.h" -#include "matrix.h" -#include "graph_state.h" -#include "stack.h" -#include "object.h" -#include "vars.h" -#include "engine.h" -#include "imageio.h" -#include "colortypes.h" -#include "render.h" -#include "bintree.h" + +#include +#include +#include +#include +#include +#include +#include RtToken RI_P = NULL; ri_var_t* V_P = NULL; diff --git a/src/jman/engine.h b/src/common/jman/engine.h similarity index 84% rename from src/jman/engine.h rename to src/common/jman/engine.h index ace790f..dd23b75 100644 --- a/src/jman/engine.h +++ b/src/common/jman/engine.h @@ -1,10 +1,17 @@ -#ifndef ENGINE_H -#define ENGINE_H +#ifndef JMAN_ENGINE_H +#define JMAN_ENGINE_H #include #include #include +#include +#include +#include +#include +#include +#include + #define ENGINE_CONTEXT_LEVEL_MAIN 0 #define ENGINE_CONTEXT_LEVEL_SUB 1 @@ -66,4 +73,4 @@ void jstats(void); void Tic(double *tic_start); double Toc(double *tic_start); -#endif // ENGINE_H +#endif // JMAN_ENGINE_H diff --git a/src/jman/graph_state.c b/src/common/jman/graph_state.c similarity index 89% rename from src/jman/graph_state.c rename to src/common/jman/graph_state.c index a11976a..5742638 100644 --- a/src/jman/graph_state.c +++ b/src/common/jman/graph_state.c @@ -1,13 +1,13 @@ #include #include -#include "ri.h" -#include "types.h" -#include "stack.h" -#include "graph_state.h" -#include "object.h" -#include "matrix.h" -#include "vars.h" -#include "engine.h" +#include +#include +#include +#include +#include +#include +#include +#include static char RI_DEFAULT_FILNAME[] = "ri.pic"; diff --git a/src/jman/graph_state.h b/src/common/jman/graph_state.h similarity index 87% rename from src/jman/graph_state.h rename to src/common/jman/graph_state.h index 25833cf..b2fc8ae 100644 --- a/src/jman/graph_state.h +++ b/src/common/jman/graph_state.h @@ -1,11 +1,11 @@ /*************************************************************************/ /* Types.h /*************************************************************************/ -#ifndef GRAPH_STATE_H -#define GRAPH_STATE_H +#ifndef JMAN_GRAPH_STATE_H +#define JMAN_GRAPH_STATE_H -#include "types.h" -#include "stack.h" +#include +#include #define PI 3.1415926535897932384626433832795 #define NUM_COORD_SYSTEMS 6 @@ -92,5 +92,5 @@ void GS_xform_push(graph_state_t *pObj); void GS_xform_pop(graph_state_t *pObj); void GS_xform_set(graph_state_t *pObj, uint32_t id); -#endif // GRAPH_STATE_H +#endif // JMAN_GRAPH_STATE_H diff --git a/src/jman/grid.c b/src/common/jman/grid.c similarity index 93% rename from src/jman/grid.c rename to src/common/jman/grid.c index 532724c..44249ea 100644 --- a/src/jman/grid.c +++ b/src/common/jman/grid.c @@ -2,14 +2,14 @@ #include #include #include -#include "ri.h" -#include "types.h" -#include "matrix.h" -#include "linklist.h" -#include "vars.h" -#include "grid.h" -#include "graph_state.h" -#include "object.h" +#include +#include +#include +#include +#include +#include +#include +#include void Grid_create(grid_t *pObj, uint32_t npu, uint32_t npv) { diff --git a/src/jman/grid.h b/src/common/jman/grid.h similarity index 85% rename from src/jman/grid.h rename to src/common/jman/grid.h index 48b35e4..b65040e 100644 --- a/src/jman/grid.h +++ b/src/common/jman/grid.h @@ -1,5 +1,5 @@ -#ifndef GRID_H -#define GRID_H +#ifndef JMAN_GRID_H +#define JMAN_GRID_H typedef struct _spoint_state_t { @@ -32,5 +32,6 @@ void Grid_assign_Ng2N(grid_t *pObj); void Grid_displace(grid_t *pObj); void Grid_shade(grid_t *pObj, RtMatrix *pXform, linkedlist_t *pLights); void Grid_shadeConstant(grid_t *pObj); +void Grid_InitUV(grid_t *pObj); -#endif // GRID +#endif // JMAN_GRID diff --git a/src/jman/imageio.c b/src/common/jman/imageio.c similarity index 90% rename from src/jman/imageio.c rename to src/common/jman/imageio.c index aea9e54..926761c 100644 --- a/src/jman/imageio.c +++ b/src/common/jman/imageio.c @@ -9,10 +9,7 @@ #include #include #include -#include "libsys.h" -#include "types.h" -#include "colortypes.h" -#include "imageio.h" +#include // ------------------------------------------------------------ double smin(double v1, double v2) @@ -76,7 +73,7 @@ void ImageCopy(image_t *pSrc, image_t *pDst) pDst->num_ch = pSrc->num_ch; if (!pDst->pColor_data) - pDst->pColor_data = (double*)jmalloc(pSrc->num_ch*pSrc->num_pixel*sizeof(double)); + pDst->pColor_data = (uint64_t*)jmalloc(pSrc->num_ch*pSrc->num_pixel*sizeof(double)); memcpy(pDst->pColor_data, pSrc->pColor_data, pSrc->num_ch*pSrc->num_pixel*sizeof(double)); diff --git a/src/jman/imageio.h b/src/common/jman/imageio.h similarity index 79% rename from src/jman/imageio.h rename to src/common/jman/imageio.h index 831fd5e..48777f6 100644 --- a/src/jman/imageio.h +++ b/src/common/jman/imageio.h @@ -5,12 +5,13 @@ // // 12.03.2005, J.Ahrensfeld // ------------------------------------------------------------ -#ifndef IMAGEIO_H -#define IMAGEIO_H +#ifndef JMAN_IMAGEIO_H +#define JMAN_IMAGEIO_H -#include "libsys.h" -#include "types.h" -#include "colortypes.h" +#include +#include +#include +#include // ------------------------------------------------------------ typedef struct _image_t @@ -30,4 +31,4 @@ int ImageSaveTiff(image_t *pObj, char *filename); void ImageSetPixel(image_t *pObj, uint32_t u, uint32_t v, rgba_t color); // ------------------------------------------------------------ -#endif // IMAGEIO_H +#endif // JMAN_IMAGEIO_H diff --git a/src/jman/linklist.c b/src/common/jman/linklist.c similarity index 93% rename from src/jman/linklist.c rename to src/common/jman/linklist.c index 936d37f..aed241c 100644 --- a/src/jman/linklist.c +++ b/src/common/jman/linklist.c @@ -1,6 +1,6 @@ #include #include -#include "linklist.h" +#include linkedlist_t* LinkedList_free(linkedlist_t *pObj) { diff --git a/src/jman/linklist.h b/src/common/jman/linklist.h similarity index 86% rename from src/jman/linklist.h rename to src/common/jman/linklist.h index 010076f..d330e0c 100644 --- a/src/jman/linklist.h +++ b/src/common/jman/linklist.h @@ -1,9 +1,8 @@ -#ifndef LINKLIST_H -#define LINKLIST_H +#ifndef JMAN_LINKLIST_H +#define JMAN_LINKLIST_H #include -#include "types.h" - +#include typedef struct _slinkedlist_t { @@ -25,4 +24,4 @@ linkedlist_t* LinkedList_del(linkedlist_t *pObj); linkedlist_t* LinkedList_find_first(linkedlist_t *pObj); linkedlist_t* LinkedList_find_last(linkedlist_t *pObj); -#endif // LINKLIST_H +#endif // JMAN_LINKLIST_H diff --git a/src/jman/matrix.c b/src/common/jman/matrix.c similarity index 95% rename from src/jman/matrix.c rename to src/common/jman/matrix.c index fde0781..821df93 100644 --- a/src/jman/matrix.c +++ b/src/common/jman/matrix.c @@ -45,9 +45,10 @@ #include +#include #include -#include "ri.h" -#include "types.h" +#include +#include #define min 1e-06 // Zahl Zahl=0 #define pi 3.14159265359 diff --git a/src/jman/matrix.h b/src/common/jman/matrix.h similarity index 88% rename from src/jman/matrix.h rename to src/common/jman/matrix.h index 73a1afa..d76f793 100644 --- a/src/jman/matrix.h +++ b/src/common/jman/matrix.h @@ -5,12 +5,12 @@ // Beschreibung: Funktionen fuer das Rechnen mit Transformationsmatrizen // // ergaenzendes Modul: matrix.cc -// letzte Änderung 01.09.199, Jens Ahrensfeld +// letzte �nderung 01.09.199, Jens Ahrensfeld -#ifndef MATRIX_H -#define MATRIX_H +#ifndef JMAN_MATRIX_H +#define JMAN_MATRIX_H -#include "ri.h" +#include extern void PrintMatrix(RtMatrix,short); extern void PrintVector(RtFloat*,short); @@ -40,4 +40,4 @@ void PointSwapXY(RtFloat *pSrcDst); void PointSwapXZ(RtFloat *pSrcDst); void PointSwapYZ(RtFloat *pSrcDst); -#endif +#endif // JMAN_MATRIX diff --git a/src/jman/object.c b/src/common/jman/object.c similarity index 94% rename from src/jman/object.c rename to src/common/jman/object.c index 8e53826..14eaeda 100644 --- a/src/jman/object.c +++ b/src/common/jman/object.c @@ -1,14 +1,14 @@ #include #include #include -#include "ri.h" -#include "types.h" -#include "graph_state.h" -#include "matrix.h" -#include "object.h" -#include "vars.h" -#include "engine.h" -#include "grid.h" +#include +#include +#include +#include +#include +#include +#include +#include extern engine_t engine; @@ -581,7 +581,7 @@ void Sphere_dice(object_t *pObj, RtInt npu, RtInt npv) du = (RtFloat)(1.0/(nu-1)); dv = (RtFloat)(1.0/(nv-1)); - // Declare variable "P" + // Declare variable +#include +#include +#include +#include + // -------------------------------------------------------------- extern RtToken OBJECT_TYPE_VERTEX; extern RtToken OBJECT_TYPE_POLYGON; @@ -149,5 +151,5 @@ RtPointer Object_get_var(object_t *pObj, RtToken name); RtPointer Object_add_var(object_t *pObj, RtToken name, RtPointer *pValues); // -------------------------------------------------------------- -#endif // OBJECT_H +#endif // JMAN_OBJECT_H diff --git a/src/jman/patches.c b/src/common/jman/patches.c similarity index 94% rename from src/jman/patches.c rename to src/common/jman/patches.c index 0a50476..69e582f 100644 --- a/src/jman/patches.c +++ b/src/common/jman/patches.c @@ -1,5 +1,5 @@ -#include "ri.h" -#include "patches.h" +#include +#include #define NU 13 #define MAXNPTS 100 diff --git a/src/jman/patches.h b/src/common/jman/patches.h similarity index 72% rename from src/jman/patches.h rename to src/common/jman/patches.h index 6f1fdb4..0f9ea38 100644 --- a/src/jman/patches.h +++ b/src/common/jman/patches.h @@ -2,7 +2,10 @@ /* From the RenderMan Companion p. 81 */ /* Listing 5.3 Bowling pin with normals assigned to vertices, defined using RiPointsPolygons */ -#include "ri.h" +#include + +#ifndef JMAN_PATCHES +#define JMAN_PATCHES typedef struct _sPoint2D { @@ -11,5 +14,4 @@ typedef struct _sPoint2D void SurfOR(Point2D points[], int npoints); - - +#endif // JMAN_PATCHES diff --git a/src/jman/patches2.c b/src/common/jman/patches2.c similarity index 94% rename from src/jman/patches2.c rename to src/common/jman/patches2.c index 5bc5587..23572a4 100644 --- a/src/jman/patches2.c +++ b/src/common/jman/patches2.c @@ -2,8 +2,8 @@ /* From the RenderMan Companion p. 81 */ /* Listing 5.3 Bowling pin with normals assigned to vertices, defined using RiPointsPolygons */ -#include "ri.h" -#include "patches.h" +#include +#include #define MAXNPTS 100 #define BEZIERWIDTH 12 diff --git a/src/jman/polys.c b/src/common/jman/polys.c similarity index 95% rename from src/jman/polys.c rename to src/common/jman/polys.c index e8e1cef..ed17254 100644 --- a/src/jman/polys.c +++ b/src/common/jman/polys.c @@ -2,8 +2,8 @@ /* From the RenderMan Companion p. 81 */ /* Listing 5.3 Bowling pin with normals assigned to vertices, defined using RiPointsPolygons */ -#include "ri.h" -#include "polys.h" +#include +#include void PolySurfOR(Point2D *points, RtColor *colors, RtInt npoints) { diff --git a/src/jman/polys.h b/src/common/jman/polys.h similarity index 84% rename from src/jman/polys.h rename to src/common/jman/polys.h index e535598..179e17c 100644 --- a/src/jman/polys.h +++ b/src/common/jman/polys.h @@ -2,7 +2,10 @@ /* From the RenderMan Companion p. 81 */ /* Listing 5.3 Bowling pin with normals assigned to vertices, defined using RiPointsPolygons */ -#include "ri.h" +#include + +#ifndef JMAN_POLYS +#define JMAN_POLYS typedef struct _sPoint2D { @@ -16,4 +19,4 @@ void getnextpair(float offset, RtPoint *ptrnextpair, RtFloat *point0, RtFloat *p #define NDIVS 24 #define MAXVERTS 1000 - +#endif // JMAN_POLYS \ No newline at end of file diff --git a/src/jman/render.c b/src/common/jman/render.c similarity index 95% rename from src/jman/render.c rename to src/common/jman/render.c index 7c1bc69..a2f4023 100644 --- a/src/jman/render.c +++ b/src/common/jman/render.c @@ -2,19 +2,7 @@ #include #include #include -#include "ri.h" -#include "types.h" -#include "matrix.h" -#include "graph_state.h" -#include "stack.h" -#include "object.h" -#include "vars.h" -#include "engine.h" -#include "imageio.h" -#include "colortypes.h" -#include "grid.h" -#include "bintree.h" -#include "render.h" +#include #define RENDER_POINTS 1 diff --git a/src/jman/render.h b/src/common/jman/render.h similarity index 59% rename from src/jman/render.h rename to src/common/jman/render.h index 59d1754..c40f84e 100644 --- a/src/jman/render.h +++ b/src/common/jman/render.h @@ -1,17 +1,18 @@ -#ifndef RENDER_H -#define RENDER_H +#ifndef JMAN_RENDER_H +#define JMAN_RENDER_H -#include "ri.h" -#include "types.h" -#include "matrix.h" -#include "graph_state.h" -#include "stack.h" -#include "object.h" -#include "vars.h" -#include "engine.h" -#include "imageio.h" -#include "colortypes.h" -#include "bintree.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include typedef struct _sshaded_pixel_t { @@ -37,4 +38,4 @@ void Render_patchmesh(render_t *pObj, object_t *pObject); void Render_sphere(render_t *pObj, object_t *pObject); void Render_patch(render_t *pObj, object_t *pObject); -#endif // RENDER_H +#endif // JMAN_RENDER_H diff --git a/src/jman/ri.c b/src/common/jman/ri.c similarity index 94% rename from src/jman/ri.c rename to src/common/jman/ri.c index 4bc3a48..b462a84 100644 --- a/src/jman/ri.c +++ b/src/common/jman/ri.c @@ -3,16 +3,16 @@ #include #include #include -#include "ri.h" -#include "types.h" -#include "matrix.h" -#include "stack.h" -#include "graph_state.h" -#include "object.h" -#include "vars.h" -#include "engine.h" -#include "linklist.h" -#include "ribgen.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // Globals engine_t engine = {0}; diff --git a/src/jman/ri.h b/src/common/jman/ri.h similarity index 97% rename from src/jman/ri.h rename to src/common/jman/ri.h index 215eab4..38c291f 100644 --- a/src/jman/ri.h +++ b/src/common/jman/ri.h @@ -2,8 +2,8 @@ * ri.h - header file for the Blue Moon Rendering Tools (BMRT) * *************************************************************************/ -#ifndef RI_H -#define RI_H 1 +#ifndef JMAN_RI_H +#define JMAN_RI_H 1 #ifdef __cplusplus extern "C" { @@ -400,5 +400,5 @@ RtVoid RiReadArchiveV (RtString filename, RtArchiveCallback callback, #endif -#endif /* RI_H */ +#endif /* JMAN_RI_H */ diff --git a/src/jman/ribgen.c b/src/common/jman/ribgen.c similarity index 94% rename from src/jman/ribgen.c rename to src/common/jman/ribgen.c index 80838f4..005ee2a 100644 --- a/src/jman/ribgen.c +++ b/src/common/jman/ribgen.c @@ -3,14 +3,14 @@ #include #include #include -#include "ri.h" -#include "types.h" -#include "matrix.h" -#include "graph_state.h" -#include "object.h" -#include "vars.h" -#include "engine.h" -#include "ribgen.h" +#include +#include +#include +#include +#include +#include +#include +#include // -------------------------------------------------------------- void RibgenPrintVars(engine_t *pObj, ri_var_t *pVar, RtPointer arg) diff --git a/src/jman/ribgen.h b/src/common/jman/ribgen.h similarity index 96% rename from src/jman/ribgen.h rename to src/common/jman/ribgen.h index 27dac5a..25ba9ae 100644 --- a/src/jman/ribgen.h +++ b/src/common/jman/ribgen.h @@ -1,5 +1,5 @@ -#ifndef RIBGEN_H -#define RIBGEN_H +#ifndef JMAN_RIBGEN_H +#define JMAN_RIBGEN_H // -------------------------------------------------------------- void Ribgen_FrameBegin(engine_t *pObj, RtInt number); @@ -40,4 +40,4 @@ void Ribgen_Surface(engine_t *pObj, char *name, va_list args); void Ribgen_Displacement(engine_t *pObj, char *name, va_list args); // -------------------------------------------------------------- -#endif // RIBGEN_H +#endif // JMAN_RIBGEN_H diff --git a/src/jman/stack.c b/src/common/jman/stack.c similarity index 90% rename from src/jman/stack.c rename to src/common/jman/stack.c index e0ae6b6..edb504f 100644 --- a/src/jman/stack.c +++ b/src/common/jman/stack.c @@ -1,6 +1,7 @@ #include #include -#include "stack.h" +#include +#include stack_t* Stack_free_top(stack_t *pObj) { diff --git a/src/jman/stack.h b/src/common/jman/stack.h similarity index 74% rename from src/jman/stack.h rename to src/common/jman/stack.h index 98e3176..c517605 100644 --- a/src/jman/stack.h +++ b/src/common/jman/stack.h @@ -1,7 +1,7 @@ -#ifndef STACK_H -#define STACK_H +#ifndef JMAN_STACK_H +#define JMAN_STACK_H -#include "types.h" +#include typedef struct _sstack_t { @@ -17,4 +17,4 @@ stack_t* Stack_free(stack_t *pObj); stack_t* Stack_push(stack_t *pObj, void **ppData, uint32_t size); stack_t* Stack_pop(stack_t *pObj, void **ppData); -#endif // STACK_H +#endif // JMAN_STACK_H diff --git a/src/jman/types.h b/src/common/jman/types.h similarity index 82% rename from src/jman/types.h rename to src/common/jman/types.h index 3a85ff2..e5b7457 100644 --- a/src/jman/types.h +++ b/src/common/jman/types.h @@ -2,8 +2,8 @@ /* Types.h */ /*************************************************************************/ -#ifndef TYPES_H -#define TYPES_H +#ifndef JMAN_TYPES_H +#define JMAN_TYPES_H #include @@ -17,4 +17,4 @@ #define MAX(a,b) ((a)>(b)?(a):(b)) #define MIN(a,b) ((a)<(b)?(a):(b)) -#endif +#endif // JMAN_TYPES_H diff --git a/src/jman/vars.c b/src/common/jman/vars.c similarity index 91% rename from src/jman/vars.c rename to src/common/jman/vars.c index 576e839..df03d3b 100644 --- a/src/jman/vars.c +++ b/src/common/jman/vars.c @@ -2,15 +2,16 @@ #include #include #include -#include "ri.h" -#include "types.h" -#include "matrix.h" -#include "graph_state.h" -#include "stack.h" -#include "object.h" -#include "imageio.h" -#include "colortypes.h" -#include "vars.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include RtToken VAR_CLASSES[] = {"vertex", "uniform", "varying", "constant", NULL}; RtToken VAR_TYPES[] = {"float", "point", "color", "string", "integer", "vector", "normal", "matrix", "hpoint", NULL}; diff --git a/src/jman/vars.h b/src/common/jman/vars.h similarity index 85% rename from src/jman/vars.h rename to src/common/jman/vars.h index b5c24cc..3b94f81 100644 --- a/src/jman/vars.h +++ b/src/common/jman/vars.h @@ -1,7 +1,8 @@ -#ifndef VARS_H -#define VARS_H +#ifndef JMAN_VARS_H +#define JMAN_VARS_H #include +#include typedef struct _sri_var_t { @@ -26,6 +27,7 @@ enum _vVarClass {VC_VERTEX, VC_UNIFORM, VC_VARYING, VC_CONSTANT}; void VarListInit(var_list_t *pObj); void VarListFree(var_list_t *pObj); +RtPointer VarGetByName(var_list_t *pObj, RtToken name); ri_var_t* VarListFindByName(var_list_t *pObj, uint8_t *name); ri_var_t* VarListDeclare(var_list_t *pObj, uint8_t *name, uint8_t *cls, uint8_t *type); ri_var_t* VarListAdd(var_list_t *pObj, ri_var_t *pVar); @@ -38,4 +40,4 @@ RtPointer VarGet(ri_var_t *pObj); void VarListPrint(var_list_t *pObj); -#endif // VARS_H +#endif // JMAN_VARS_H diff --git a/src/jman/main_patches.c b/src/main_patches.c similarity index 95% rename from src/jman/main_patches.c rename to src/main_patches.c index c00450e..8e21c22 100644 --- a/src/jman/main_patches.c +++ b/src/main_patches.c @@ -3,8 +3,8 @@ /* Listing 8.5 An improved boilerplate viewing program */ #include -#include "ri.h" -#include "camset.h" +#include +#include #define NFRAMES 20 #define SHADING_RATE 20 @@ -45,7 +45,7 @@ #define Z2 .33 #define Z3 1 -PatchExample(Patch) +void PatchExample(Patch) RtPoint Patch[4][4]; { RtPoint blpatch[2][2]; @@ -80,7 +80,7 @@ RtPoint Patch[4][4]; #endif } -Go() +void Go() { static RtPoint Patch[16] = { { X0, Y0, Z0}, { X1, Y2, Z0}, { X2, Y1, Z0}, { X3, Y3, Z0}, @@ -107,7 +107,7 @@ typedef struct _testi RtPointer p; } testi; -main() +int main() { RtInt frame, i, nverts[] = {4, 4}; RtToken my_var; diff --git a/src/jman/main_patchmeshes.c b/src/main_patchmeshes.c similarity index 93% rename from src/jman/main_patchmeshes.c rename to src/main_patchmeshes.c index 51dbeb7..8706aca 100644 --- a/src/jman/main_patchmeshes.c +++ b/src/main_patchmeshes.c @@ -3,9 +3,9 @@ /* Listing 8.5 An improved boilerplate viewing program */ #include -#include "ri.h" -#include "camset.h" -#include "patches.h" +#include +#include +#include #define NFRAMES 25 diff --git a/src/jman/main_polypin.c b/src/main_polypin.c similarity index 94% rename from src/jman/main_polypin.c rename to src/main_polypin.c index 24de412..749fcfd 100644 --- a/src/jman/main_polypin.c +++ b/src/main_polypin.c @@ -3,9 +3,9 @@ /* Listing 8.5 An improved boilerplate viewing program */ #include -#include "ri.h" -#include "camset.h" -#include "polys.h" +#include +#include +#include /* viewbasics.c: file compiling view options into a rendering shell. */