- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Getting sizes of source/header files from exec...
Operating System - HP-UX
1753477
Members
4900
Online
108794
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-11-2011 11:08 PM
тАО01-11-2011 11:08 PM
Getting sizes of source/header files from executable with using the what utility
Hi,
I need to get size of source/header files from executables/libraties with using the what utiliry.
Getting sizes of source files is shown below.
Is there any way to get also sizes of header files?
Thanks,
Alex Vinokur
====== Environment : BEGIN ======
> uname -lmrsv
HP-UX B.11.23 U ia64 unlimited-user license
> aCC -V
aCC: HP C/aC++ B3910B A.06.25.01 [May 16 2010]
> make -v
GNU Make 3.81
====== Environment : END ======
====== makefile1 : BEGIN ======
# makefile1
CC = aCC
CFLAGS = +DD64 -AA
CFLAGS += -DFILE_WC="`wc $<`"
LDFLAGS = +DD64 -AA
SOURCES=foo_main.cpp foo.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=hello
all: clean $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -o $@
.cpp.o:
$(CC) $(CFLAGS) -c $<
clean:
@rm -rf $(EXECUTABLE) $(OBJECTS)
====== makefile1 : END ======
====== foo_macro.h : BEGIN ======
// File foo_macro.h
#ifndef __FOO_MACRO_H__
#define __FOO_MACRO_H__
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
#define FIRST_SCCS_CHAR "@"
#define SCCS_PREFIX FIRST_SCCS_CHAR"(#)"
#define SOURCE_IDENT_INFO SCCS_PREFIX""__FILE__",\tSize = "TOSTRING(FILE_WC)
#define HEADER_IDENT_INFO SCCS_PREFIX""__FILE__",\tSize = ???"
static const char id_foo_macro[] = HEADER_IDENT_INFO;
#endif // __FOO_MACRO_H__
====== foo_macro.h : BEGIN ======
====== foo.h : BEGIN ======
// File foo.h
#ifndef __FOO_H__
#define __FOO_H__
#include "foo_macro.h"
static const char id_foo[] = HEADER_IDENT_INFO;
#endif // __FOO_H__
====== foo.h : BEGIN ======
====== foo2.h : BEGIN ======
// File foo2.h
#ifndef __FOO2_H__
#define __FOO2_H__
#include "foo_macro.h"
static const char id_foo2[] = HEADER_IDENT_INFO;
#endif // __FOO2_H__
====== foo2.h : BEGIN ======
====== foo.cpp : BEGIN ======
// File foo.cpp
#include "foo.h"
#include "foo2.h"
static const char id[] = SOURCE_IDENT_INFO;
====== foo.cpp : BEGIN ======
====== foo_main.cpp : BEGIN ======
// File foo_main.cpp
#include "foo.h"
static const char id[] = SOURCE_IDENT_INFO;
int main()
{
return 0;
}
====== foo_main.cpp : BEGIN ======
###################################
// Compilation
> make -f makefile1
aCC +DD64 -AA -DFILE_WC="`wc foo_main.cpp`" -c foo_main.cpp
aCC +DD64 -AA -DFILE_WC="`wc foo.cpp`" -c foo.cpp
aCC +DD64 -AA foo_main.o foo.o -o hello
> what hello
hello:
foo_macro.h, Size = ???
foo.h, Size = ???
foo_main.cpp, Size = 9 17 110 foo_main.cpp
foo_macro.h, Size = ???
foo.h, Size = ???
foo2.h, Size = ???
foo.cpp, Size = 5 13 96 foo.cpp
I need to get size of source/header files from executables/libraties with using the what utiliry.
Getting sizes of source files is shown below.
Is there any way to get also sizes of header files?
Thanks,
Alex Vinokur
====== Environment : BEGIN ======
> uname -lmrsv
HP-UX B.11.23 U ia64 unlimited-user license
> aCC -V
aCC: HP C/aC++ B3910B A.06.25.01 [May 16 2010]
> make -v
GNU Make 3.81
====== Environment : END ======
====== makefile1 : BEGIN ======
# makefile1
CC = aCC
CFLAGS = +DD64 -AA
CFLAGS += -DFILE_WC="`wc $<`"
LDFLAGS = +DD64 -AA
SOURCES=foo_main.cpp foo.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=hello
all: clean $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -o $@
.cpp.o:
$(CC) $(CFLAGS) -c $<
clean:
@rm -rf $(EXECUTABLE) $(OBJECTS)
====== makefile1 : END ======
====== foo_macro.h : BEGIN ======
// File foo_macro.h
#ifndef __FOO_MACRO_H__
#define __FOO_MACRO_H__
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
#define FIRST_SCCS_CHAR "@"
#define SCCS_PREFIX FIRST_SCCS_CHAR"(#)"
#define SOURCE_IDENT_INFO SCCS_PREFIX""__FILE__",\tSize = "TOSTRING(FILE_WC)
#define HEADER_IDENT_INFO SCCS_PREFIX""__FILE__",\tSize = ???"
static const char id_foo_macro[] = HEADER_IDENT_INFO;
#endif // __FOO_MACRO_H__
====== foo_macro.h : BEGIN ======
====== foo.h : BEGIN ======
// File foo.h
#ifndef __FOO_H__
#define __FOO_H__
#include "foo_macro.h"
static const char id_foo[] = HEADER_IDENT_INFO;
#endif // __FOO_H__
====== foo.h : BEGIN ======
====== foo2.h : BEGIN ======
// File foo2.h
#ifndef __FOO2_H__
#define __FOO2_H__
#include "foo_macro.h"
static const char id_foo2[] = HEADER_IDENT_INFO;
#endif // __FOO2_H__
====== foo2.h : BEGIN ======
====== foo.cpp : BEGIN ======
// File foo.cpp
#include "foo.h"
#include "foo2.h"
static const char id[] = SOURCE_IDENT_INFO;
====== foo.cpp : BEGIN ======
====== foo_main.cpp : BEGIN ======
// File foo_main.cpp
#include "foo.h"
static const char id[] = SOURCE_IDENT_INFO;
int main()
{
return 0;
}
====== foo_main.cpp : BEGIN ======
###################################
// Compilation
> make -f makefile1
aCC +DD64 -AA -DFILE_WC="`wc foo_main.cpp`" -c foo_main.cpp
aCC +DD64 -AA -DFILE_WC="`wc foo.cpp`" -c foo.cpp
aCC +DD64 -AA foo_main.o foo.o -o hello
> what hello
hello:
foo_macro.h, Size = ???
foo.h, Size = ???
foo_main.cpp, Size = 9 17 110 foo_main.cpp
foo_macro.h, Size = ???
foo.h, Size = ???
foo2.h, Size = ???
foo.cpp, Size = 5 13 96 foo.cpp
- Tags:
- include
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2011 01:37 AM
тАО01-12-2011 01:37 AM
Re: Getting sizes of source/header files from executable with using the what utility
>Is there any way to get also sizes of header files?
Only if you make your script smarter and have it search though all of the -I paths to find the header. And you would need a macro for each header you were interested in.
Only if you make your script smarter and have it search though all of the -I paths to find the header. And you would need a macro for each header you were interested in.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2011 10:34 PM
тАО01-12-2011 10:34 PM
Re: Getting sizes of source/header files from executable with using the what utility
We have some progress. We can get sizes of header files with using the what utility
====== Environment : BEGIN ======
> uname -lmrsv
HP-UX B.11.23 U ia64 unlimited-user license
> aCC -V
aCC: HP C/aC++ B3910B A.06.25.01 [May 16 2010]
> make -v
GNU Make 3.81
====== Environment : END ======
====== makefile2 : BEGIN ======
# makefile1
MAKEFILE = makefile2
MAKEDEPEND = makedepend
CC = aCC
CFLAGS = +DD64 -AA
APP_INCLUDES = -I. -I./inc
CFLAGS += -DSOURCE_FILE_WC="`wc $<`" -DHEADER_FILE_WC="`makedepend $(APP_INCLUDES) $<; cat makefile | tail -1 | sed "s/.*://" | xargs wc | tr '"'"'"\n"'"'"' '"'"'" '"'"'" "
LDFLAGS = +DD64 -AA
SOURCES=foo_main.cpp foo.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=hello
all: clean $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -o $@
.cpp.o:
$(MAKEDEPEND) $<
$(CC) $(CFLAGS) $(APP_INCLUDES) -c $<
clean:
@rm -rf $(EXECUTABLE) $(OBJECTS)
====== makefile2 : END ======
====== foo_macro.h : BEGIN ======
// File foo_macro.h
#ifndef __FOO_MACRO_H__
#define __FOO_MACRO_H__
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
#define FIRST_SCCS_CHAR "@"
#define SCCS_PREFIX FIRST_SCCS_CHAR"(#)"
#define SOURCE_IDENT_INFO SCCS_PREFIX"SOURCE_SISE "__FILE__": \tSize = "TOSTRING(SOURCE_FILE_WC)
#define HEADER_IDENT_INFO SCCS_PREFIX"HEADER_SISE "__FILE__": \tSizes = "TOSTRING(HEADER_FILE_WC)
#endif // __FOO_MACRO_H__
====== foo_macro.h : BEGIN ======
====== foo.h : BEGIN ======
// File foo.h
#ifndef __FOO_H__
#define __FOO_H__
#include "foo_macro.h"
#include
#endif // __FOO_H__
====== foo.h : END ======
====== foo2.h : BEGIN ======
// File foo2.h
#ifndef __FOO2_H__
#define __FOO2_H__
#include "foo_macro.h"
#endif // __FOO2_H__
====== foo2.h : END ======
====== foo.cpp : BEGIN ======
// File foo.cpp
#include "foo.h"
#include "foo2.h"
static const char id1[] = SOURCE_IDENT_INFO;
static const char id2[] = HEADER_IDENT_INFO;
====== foo.cpp : END ======
====== foo_main.cpp : BEGIN ======
// File foo_main.cpp
#include "foo.h"
static const char id1[] = SOURCE_IDENT_INFO;
static const char id2[] = HEADER_IDENT_INFO;
int main()
{
return 0;
}
====== foo_main.cpp : END ======
###################################
// Compilation
> make -f makefile2
makedepend foo_main.cpp
makedepend: warning: foo_main.cpp (reading foo.h, line 9): cannot find include file "iostream"
not in iostream
not in /usr/include/iostream
aCC +DD64 -AA -DSOURCE_FILE_WC="`wc foo_main.cpp`" -DHEADER_FILE_WC="`makedepend -I. -I./inc foo_main.cpp; cat makefile | tail -1 | sed "s/.*://" | xargs wc | tr '"'"'"\n"'"'"' '"'"'" '"'"'" " -I. -I./inc -c foo_main.cpp
makedepend: warning: foo_main.cpp (reading foo.h, line 9): cannot find include file "iostream"
not in iostream
not in ./iostream
not in ./inc/iostream
not in /usr/include/iostream
makedepend foo.cpp
makedepend: warning: foo.cpp (reading foo.h, line 9): cannot find include file "iostream"
not in iostream
not in /usr/include/iostream
makedepend: warning: foo.cpp, line 3: cannot find include file "foo2.h"
not in foo2.h
not in foo2.h
not in /usr/include/foo2.h
aCC +DD64 -AA -DSOURCE_FILE_WC="`wc foo.cpp`" -DHEADER_FILE_WC="`makedepend -I. -I./inc foo.cpp; cat makefile | tail -1 | sed "s/.*://" | xargs wc | tr '"'"'"\n"'"'"' '"'"'" '"'"'" " -I. -I./inc -c foo.cpp
makedepend: warning: foo.cpp (reading foo.h, line 9): cannot find include file "iostream"
not in iostream
not in ./iostream
not in ./inc/iostream
not in /usr/include/iostream
aCC +DD64 -AA foo_main.o foo.o -o hello
> what hello
hello:
SOURCE_SISE foo_main.cpp: Size = 10 23 156 foo_main.cpp
HEADER_SISE foo_main.cpp: Sizes = 17 14 124 foo.h 17 36 428 foo_macro.h 34 50 552 total
SOURCE_SISE foo.cpp: Size = 7 19 143 foo.cpp
HEADER_SISE foo.cpp: Sizes = 17 14 124 foo.h 17 36 428 foo_macro.h 9 12 101 ./inc/foo2.h 43 62 653 total
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP