yuezonghe | 824eb0c | 2024-06-27 02:32:26 -0700 | [diff] [blame^] | 1 | From 5b1e973b2333e838624abf195b3ba9716591f304 Mon Sep 17 00:00:00 2001 |
| 2 | From: Gustavo Zacarias <gustavo@zacarias.com.ar> |
| 3 | Date: Sun, 10 Oct 2021 10:15:26 +0200 |
| 4 | Subject: [PATCH] Add new targets for iozone: |
| 5 | |
| 6 | linux-noaio is for linux targets without AIO (use case: uClibc) |
| 7 | linux-noth is for linux target without threads or AIO |
| 8 | |
| 9 | And make largefile support optional via CFLAGS. |
| 10 | |
| 11 | Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> |
| 12 | Signed-off-by: Gilles Talis <gilles.talis@gmail.com> |
| 13 | --- |
| 14 | src/current/makefile | 56 +++++++++++++++++++++++++++++++++++++------- |
| 15 | 1 file changed, 47 insertions(+), 9 deletions(-) |
| 16 | |
| 17 | diff --git a/src/current/makefile b/src/current/makefile |
| 18 | index 3a54701..3b17b1b 100644 |
| 19 | --- a/src/current/makefile |
| 20 | +++ b/src/current/makefile |
| 21 | @@ -172,10 +172,28 @@ hpux_no_ansi: iozone_hpux_no.o libbif.o |
| 22 | # GNU 'C' compiler Linux build with threads, largefiles, async I/O |
| 23 | # |
| 24 | linux: iozone_linux.o libasync.o libbif.o fileop_linux.o pit_server.o |
| 25 | - $(CC) -O3 $(CFLAGS) iozone_linux.o libasync.o libbif.o -lpthread \ |
| 26 | + $(CC) $(CFLAGS) $(LDFLAGS) iozone_linux.o libasync.o libbif.o \ |
| 27 | + -lpthread -lrt -o iozone |
| 28 | + $(CC) $(CFLAGS) -Dlinux fileop_linux.o -o fileop |
| 29 | + $(CC) $(CFLAGS) -Dlinux pit_server.o -o pit_server |
| 30 | + |
| 31 | +# |
| 32 | +# GNU 'C' compiler Linux build with threads, largefiles |
| 33 | +# |
| 34 | +linux-noaio: iozone_linux-noaio.o libbif.o fileop_linux.o pit_server.o |
| 35 | + $(CC) $(CFLAGS) $(LDFLAGS) iozone_linux-noaio.o libbif.o \ |
| 36 | + -lpthread -lrt -o iozone |
| 37 | + $(CC) $(CFLAGS) -Dlinux fileop_linux.o -o fileop |
| 38 | + $(CC) $(CFLAGS) -Dlinux pit_server.o -o pit_server |
| 39 | + |
| 40 | +# |
| 41 | +# GNU 'C' compiler Linux build with largefiles |
| 42 | +# |
| 43 | +linux-noth: iozone_linux-noth.o libbif.o fileop_linux.o pit_server.o |
| 44 | + $(CC) $(CFLAGS) $(LDFLAGS) iozone_linux-noth.o libbif.o \ |
| 45 | -lrt -o iozone |
| 46 | - $(CC) -O3 $(CFLAGS) -Dlinux fileop_linux.o -o fileop |
| 47 | - $(CC) -O3 $(CFLAGS) -Dlinux pit_server.o -o pit_server |
| 48 | + $(CC) $(CFLAGS) -Dlinux fileop_linux.o -o fileop |
| 49 | + $(CC) $(CFLAGS) -Dlinux pit_server.o -o pit_server |
| 50 | |
| 51 | # |
| 52 | # GNU 'C' compiler Linux build for powerpc chip with threads, largefiles, async I/O |
| 53 | @@ -841,13 +859,33 @@ iozone_linux.o: iozone.c libbif.c libasync.c |
| 54 | @echo "" |
| 55 | @echo "Building iozone for Linux" |
| 56 | @echo "" |
| 57 | - $(CC) -Wmissing-prototypes -Wall -c -O3 -Dunix -DHAVE_ANSIC_C -DASYNC_IO -DHAVE_PREAD \ |
| 58 | - -DSHARED_MEM -Dlinux -D_LARGEFILE64_SOURCE $(CFLAGS) iozone.c \ |
| 59 | + $(CC) -Wmissing-prototypes -Wall -c -Dunix -DHAVE_ANSIC_C -DASYNC_IO -DHAVE_PREAD \ |
| 60 | + -DSHARED_MEM -Dlinux $(CFLAGS) iozone.c \ |
| 61 | -DNAME='"linux"' -o iozone_linux.o |
| 62 | - $(CC) -Wmissing-prototypes -Wall -c -O3 -Dunix -DHAVE_ANSIC_C -DASYNC_IO -D_LARGEFILE64_SOURCE \ |
| 63 | + $(CC) -Wmissing-prototypes -Wall -c -Dunix -DHAVE_ANSIC_C -DASYNC_IO \ |
| 64 | + -DSHARED_MEM -Dlinux $(CFLAGS) libbif.c -o libbif.o |
| 65 | + $(CC) -Wmissing-prototypes -Wall -c -Dunix -Dlinux -DHAVE_ANSIC_C -DASYNC_IO \ |
| 66 | + $(CFLAGS) libasync.c -o libasync.o |
| 67 | + |
| 68 | +iozone_linux-noaio.o: iozone.c libbif.c |
| 69 | + @echo "" |
| 70 | + @echo "Building iozone for Linux no AIO" |
| 71 | + @echo "" |
| 72 | + $(CC) -Wmissing-prototypes -Wall -c -Dunix -DHAVE_ANSIC_C -DHAVE_PREAD \ |
| 73 | + -DSHARED_MEM -Dlinux $(CFLAGS) iozone.c \ |
| 74 | + -DNAME='"linux"' -o iozone_linux-noaio.o |
| 75 | + $(CC) -Wmissing-prototypes -Wall -c -Dunix -DHAVE_ANSIC_C \ |
| 76 | + -DSHARED_MEM -Dlinux $(CFLAGS) libbif.c -o libbif.o |
| 77 | + |
| 78 | +iozone_linux-noth.o: iozone.c libbif.c |
| 79 | + @echo "" |
| 80 | + @echo "Building iozone for Linux with no threads" |
| 81 | + @echo "" |
| 82 | + $(CC) -Wmissing-prototypes -Wall -c -Dunix -DHAVE_ANSIC_C -DNO_THREADS -DHAVE_PREAD \ |
| 83 | + -DSHARED_MEM -Dlinux $(CFLAGS) iozone.c \ |
| 84 | + -DNAME='"linux"' -o iozone_linux-noth.o |
| 85 | + $(CC) -Wmissing-prototypes -Wall -c -Dunix -DHAVE_ANSIC_C -DNO_THREADS \ |
| 86 | -DSHARED_MEM -Dlinux $(CFLAGS) libbif.c -o libbif.o |
| 87 | - $(CC) -Wmissing-prototypes -Wall -c -O3 -Dunix -Dlinux -DHAVE_ANSIC_C -DASYNC_IO \ |
| 88 | - -D_LARGEFILE64_SOURCE $(CFLAGS) libasync.c -o libasync.o |
| 89 | |
| 90 | fileop_AIX.o: fileop.c |
| 91 | @echo "" |
| 92 | @@ -951,7 +989,7 @@ fileop_linux.o: fileop.c |
| 93 | @echo "" |
| 94 | @echo "Building fileop for Linux" |
| 95 | @echo "" |
| 96 | - $(CC) -Wall -c -O3 $(CFLAGS) fileop.c -o fileop_linux.o |
| 97 | + $(CC) -Wall -c $(CFLAGS) fileop.c -o fileop_linux.o |
| 98 | |
| 99 | fileop_openbsd.o: fileop.c |
| 100 | @echo "" |
| 101 | -- |
| 102 | 2.27.0 |
| 103 | |