Check-in [52cac69aea]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add -linker to command line 6519ea274e
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:52cac69aeaca4173bca5b6a09cf5a12dd9c2e7e5
User & Date: jim 2012-07-23 14:46:29
References
2012-07-23
14:46 Tested ticket [6519ea274e]: Add linker option to command line plus 3 other changes artifact: e74be07c2a user: jim
Context
2012-08-11
11:27
Update to handle [632b9cc629] check-in: e0da51283c user: jim tags: trunk
2012-07-23
14:46
Add -linker to command line 6519ea274e check-in: 52cac69aea user: jim tags: trunk
12:54
Initial Commit check-in: 47a9fc7bfc user: jim tags: trunk
Changes

Changes to BASE_PC/Dohickies/CLexFile.h.

1
/************************************************************************ *																		* * 			Pandora Products - Jim Schimpf Std Support Stuff			* *					Copyright 1998 Jim Schimpf							* *  																		* *						MAC FILE LEXICAL ANALYZER						* *																		* *		Module:CTokFile.h												* *																		* *	Version		Date	Person  	Description							* *-----------------------------------------------------------------------* *	0.1		12-Feb-88	J.Schimpf	Initial Version						* *	0.2		 3-Aug-91	J.Schimpf	Add seek,tell & rewind				* *	0.3		 1-Jan-92	J.Schimpf	Add file name to MFILE				* *	0.4		 8-Aug-95	J.Schimpf	Convert to object					* *	0.5		22-Sep-95	J.Schimpf	Convert to file tokenizer			* *	0.6		22-Jan-97	J.Schimpf	Add initializer						* *																		* *	DESCRIPTION:													    * *		Converts file to a stream of tokens								* *		TOKEN := [<WS chars>]<Contigious characters = TOKEN>[<WS>]		* *				 Maximum # characters in token in MAX_TOK				* *		Characters in a line following <COMMENT_CHAR> are ignored to EOL* *		NOTE: Files are treated as lines and TOKENS cannot be extend	* *		over line breaks												* *																		* *																		* ************************************************************************/  #include "CTokFile.h"  #pragma once  /*  USEFUL STUFF */  #define MAX_LEX_TOK_SIZE	32			// Max size of searched for token  typedef struct { 					int lex_value; 					char token[MAX_LEX_TOK_SIZE]; 				} LEX_TOKEN;  #define MAX_LEX_LIST_SIZE	32			// Maximum # tokens to find   // Lexical returns  #define LEX_BUF_EOL		-2		// End of line found #define LEX_BUF_EOF		-1		// End of FILE found #define LEX_BUF_TOK		-3		// Token returned	Unmatched token found #define LEX_QUOT_TOK	-4		// Quoted token 			 /************************************************************ *		OBJECT DEFS ************************************************************/  class CLexFile : public CTokFile {  	public: 	 		void init(int cnt,LEX_TOKEN *tlist);	// Initialize for run 		 		int get_token( char *token );			// Get a token 		void unget_token(void);					// Unget last token received 		 	private:  		LEX_TOKEN	list[MAX_LEX_LIST_SIZE]; 		int numTokens;							// # Tokens in list  };
|
1
/************************************************************************ *																		* * 			Pandora Products - Jim Schimpf Std Support Stuff			* *					Copyright 1998 Jim Schimpf							* *  																		* *						MAC FILE LEXICAL ANALYZER						* *																		* *		Module:CTokFile.h												* *																		* *	Version		Date	Person  	Description							* *-----------------------------------------------------------------------* *	0.1		12-Feb-88	J.Schimpf	Initial Version						* *	0.2		 3-Aug-91	J.Schimpf	Add seek,tell & rewind				* *	0.3		 1-Jan-92	J.Schimpf	Add file name to MFILE				* *	0.4		 8-Aug-95	J.Schimpf	Convert to object					* *	0.5		22-Sep-95	J.Schimpf	Convert to file tokenizer			* *	0.6		22-Jan-97	J.Schimpf	Add initializer						* *																		* *	DESCRIPTION:													    * *		Converts file to a stream of tokens								* *		TOKEN := [<WS chars>]<Contigious characters = TOKEN>[<WS>]		* *				 Maximum # characters in token in MAX_TOK				* *		Characters in a line following <COMMENT_CHAR> are ignored to EOL* *		NOTE: Files are treated as lines and TOKENS cannot be extend	* *		over line breaks												* *																		* *																		* ************************************************************************/  #include "CTokFile.h"  #pragma once  /*  USEFUL STUFF */  #define MAX_LEX_TOK_SIZE	1024			// Max size of searched for token  typedef struct { 					int lex_value; 					char token[MAX_LEX_TOK_SIZE]; 				} LEX_TOKEN;  #define MAX_LEX_LIST_SIZE	32			// Maximum # tokens to find   // Lexical returns  #define LEX_BUF_EOL		-2		// End of line found #define LEX_BUF_EOF		-1		// End of FILE found #define LEX_BUF_TOK		-3		// Token returned	Unmatched token found #define LEX_QUOT_TOK	-4		// Quoted token 			 /************************************************************ *		OBJECT DEFS ************************************************************/  class CLexFile : public CTokFile {  	public: 	 		void init(int cnt,LEX_TOKEN *tlist);	// Initialize for run 		 		int get_token( char *token );			// Get a token 		void unget_token(void);					// Unget last token received 		 	private:  		LEX_TOKEN	list[MAX_LEX_LIST_SIZE]; 		int numTokens;							// # Tokens in list  };

Changes to BASE_PC/Dohickies/CpbxLexFile.h.

1
/************************************************************************ *																		* * 					Jim Schimpf - Pandora Products 						* *					Copyright 2002 Jim Schimpf							* *  																		* *					MAC PROJECT BUILDER LEXICAL ANALYZER				* *																		* *		Module:CpbxLexFile.h											* *																		* *	Version		Date	Person  	Description							* *-----------------------------------------------------------------------* *	1.0		27-Jul-2002	J.Schimpf	Convert to pbxproj file lexer		* *	1.1		27-Sep-2003 J.Schimpf	Add string marker					* *																		* *	DESCRIPTION:													    * *		Converts file to a stream of tokens								* *		TOKEN := [<WS chars>]<Contigious characters = TOKEN>[<WS>]		* *				 Maximum # characters in token in MAX_TOK				* *		Characters in a line following <COMMENT_CHAR> are ignored to EOL* *		NOTE: Files are treated as lines and TOKENS cannot be extend	* *		over line breaks												* *																		* *																		* ************************************************************************/  #include "CLexFile.h"  #pragma once  /*  USEFUL STUFF */  #define MAX_C_TOKEN		128  // *** POSSIBLE C TYPES TO BE DECODED *** enum { 		P_TOK_PATH, 		P_TOK_OBJ_START, 		P_TOK_OBJ_END, 		P_TOK_END, 		P_TOK_LINK, 		P_TOK_LIST, 		P_TOK_NAME, 		P_TOK_UNKPUNCT 	}; 			 /************************************************************ *		OBJECT DEFS ************************************************************/  class CpbxLexFile : public CLexFile {  	public: 	 		void init(void);	// Initialize for run 		 		int get_token( char *token );			// Get a token 		void unget_token();						// Unget last token received 		int get_char( );						// Pull one character at a time 		void unget_char();						// Restore last char to buf 	private:  		int get_pending_token( char *token );  		char cur_token[MAX_C_TOKEN]; 		int tok_psn; 		 		// Added to handle UNGET 		 		bool unget; 		char unget_val[MAX_C_TOKEN]; 		int unget_type;  };
|
1
/************************************************************************ *																		* * 					Jim Schimpf - Pandora Products 						* *					Copyright 2002 Jim Schimpf							* *  																		* *					MAC PROJECT BUILDER LEXICAL ANALYZER				* *																		* *		Module:CpbxLexFile.h											* *																		* *	Version		Date	Person  	Description							* *-----------------------------------------------------------------------* *	1.0		27-Jul-2002	J.Schimpf	Convert to pbxproj file lexer		* *	1.1		27-Sep-2003 J.Schimpf	Add string marker					* *																		* *	DESCRIPTION:													    * *		Converts file to a stream of tokens								* *		TOKEN := [<WS chars>]<Contigious characters = TOKEN>[<WS>]		* *				 Maximum # characters in token in MAX_TOK				* *		Characters in a line following <COMMENT_CHAR> are ignored to EOL* *		NOTE: Files are treated as lines and TOKENS cannot be extend	* *		over line breaks												* *																		* *																		* ************************************************************************/  #include "CLexFile.h"  #pragma once  /*  USEFUL STUFF */  #define MAX_C_TOKEN		1024  // *** POSSIBLE C TYPES TO BE DECODED *** enum { 		P_TOK_PATH, 		P_TOK_OBJ_START, 		P_TOK_OBJ_END, 		P_TOK_END, 		P_TOK_LINK, 		P_TOK_LIST, 		P_TOK_NAME, 		P_TOK_UNKPUNCT 	}; 			 /************************************************************ *		OBJECT DEFS ************************************************************/  class CpbxLexFile : public CLexFile {  	public: 	 		void init(void);	// Initialize for run 		 		int get_token( char *token );			// Get a token 		void unget_token();						// Unget last token received 		int get_char( );						// Pull one character at a time 		void unget_char();						// Restore last char to buf 	private:  		int get_pending_token( char *token );  		char cur_token[MAX_C_TOKEN]; 		int tok_psn; 		 		// Added to handle UNGET 		 		bool unget; 		char unget_val[MAX_C_TOKEN]; 		int unget_type;  };

Changes to CMaker.cp.

63
64
65
66
67
68
69

70
71
72
73
74
75
76
...
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
...
323
324
325
326
327
328
329

330

331
332
333
334
335
336



337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
...
863
864
865
866
867
868
869

870
871
872
873
874
875
876
877
878



879
880
881
882
883
884
885
...
906
907
908
909
910
911
912

913
914
915
916
917
918
919
...
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
*	2.7		 3-Nov-2006	J.Schimpf	Change to remove extra /n between	*
*									obj list and main C compile			*
*	2.8		 7-Dec-2006	J.Schimpf	Change parse() to check for non		*
*									null target before looking at		*
*									string								*
*	2.9		 7-Sep-2008	J.Schimpf	Add obj.c type to sources in		*
*									gatherline							*

*																		*
*	DESCRIPTION:													    *
*		This class takes as input a open write file (makefile) and		*
*	a PBXPROJ structure and uses this to build a make file for the proj	*
*			(1) Scan to find PBXFileReference section					*
*				(a) Read {....} section and pull out KVP's				*
*				(b) Store .c files & paths in FILES						*
................................................................................
{
	char token[MAX_TOK+1];
	int type;
	int state  = 0;
	bool run = true;
	bool rtnval = false;		// Assume failure
	
	// (1) Search for PBXFileReferencee section
	
	while( run )
	{
		type = base->get_token(token);
		if( type == TOK_BUF_EOF )
			break;
			
................................................................................
/***********************************************************************
*
*  bool build(char *compiler)	- Build the make file
*
*	INPUT:	pgmid		- Creator program string
*			compiler	- Name of compiler used 
*			cc_opt		- Compiler options

*			link_opt	- Link options

*
*	OUTPUT:	TRUE if run ok FALSE if not
*
***********************************************************************/

bool CMaker::build(char *pgmid,char *compiler,char *cc_opt,char *link_opt, char *bin_dir)



{
	
	if( debug )
		this->build_print();
    
    // (5) We have all the parts build the make file
    
	if( proj_ok )
	{
		if( this->build_make(pgmid,compiler,cc_opt,link_opt, bin_dir) )
			return( true );
	}
    else
	{
		printf("** BAD PROJECT FILE FIX AND TRY AGAIN\n");
        return( false );
	}
................................................................................
/***********************************************************************
*
*   bool build_make( char *compiler )	- Build the makefile 
*
*	INPUT:	pgmid		- Creator pogram ID
*			compiler	- String name of compiler
*			cc_opt		- Compiler options

*			link_opt	- Linker options
*
*	OUTPUT:	TRUE if makefile OK, FALSE if not
*
*  13-Oct-2006 Change here to specify object file lcn
*
***********************************************************************/

bool CMaker::build_make( char *id,char *compiler,char *cc_opt,char *link_opt, char *bin_dir)



{
    FILE_LIST *fl;
	time_t t;
	char buf[32];
	int n;
	int count = 1;
	bool first = true;
................................................................................
    fprintf(make,"\n");
    fprintf(make,"#\n");
    fprintf(make,"# Macros\n");
    fprintf(make,"#\n");
    fprintf(make,"\n");
    fprintf(make,"CC = %s\n",compiler);
    fprintf(make,"CC_OPTIONS = %s\n",cc_opt);

	
	this->linker_line(link_opt);

    // (2) Trim the paths from the include file list
    // and build the INCLUDE macro
    
	fprintf(make,"\n");
................................................................................
		}
        fl = fl->next;
    }
    fprintf(make,"\n");			// Terminate the section
								// NOTE: Remove extra LF between this and 
								// compile line REF:JS03112006

    fprintf(make,"\t$(CC) $(LNK_OPTIONS) \\\n");	// REF:JS06032004 alone on line
    fl = cfiles;

	// Loop for all the o files
	
    while( fl != NULL )
    {
		if( target_files->check(fl->name))







>







 







|







 







>

>





|
>
>
>









|







 







>








|
>
>
>







 







>







 







|







63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
...
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
...
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
...
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
...
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
...
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
*	2.7		 3-Nov-2006	J.Schimpf	Change to remove extra /n between	*
*									obj list and main C compile			*
*	2.8		 7-Dec-2006	J.Schimpf	Change parse() to check for non		*
*									null target before looking at		*
*									string								*
*	2.9		 7-Sep-2008	J.Schimpf	Add obj.c type to sources in		*
*									gatherline							*
*	2.10	23-Jul-2012	J.Schimpf	Add linker cmd option 6519ea274e	*
*																		*
*	DESCRIPTION:													    *
*		This class takes as input a open write file (makefile) and		*
*	a PBXPROJ structure and uses this to build a make file for the proj	*
*			(1) Scan to find PBXFileReference section					*
*				(a) Read {....} section and pull out KVP's				*
*				(b) Store .c files & paths in FILES						*
................................................................................
{
	char token[MAX_TOK+1];
	int type;
	int state  = 0;
	bool run = true;
	bool rtnval = false;		// Assume failure
	
	// (1) Search for PBXFileReference section
	
	while( run )
	{
		type = base->get_token(token);
		if( type == TOK_BUF_EOF )
			break;
			
................................................................................
/***********************************************************************
*
*  bool build(char *compiler)	- Build the make file
*
*	INPUT:	pgmid		- Creator program string
*			compiler	- Name of compiler used 
*			cc_opt		- Compiler options
*			linker		- Name of linker used
*			link_opt	- Link options
*			bin_dir		- Output bin directory
*
*	OUTPUT:	TRUE if run ok FALSE if not
*
***********************************************************************/

bool CMaker::build(char *pgmid,
					char *compiler,char *cc_opt,
					char *linker,char *link_opt, 
					char *bin_dir)
{
	
	if( debug )
		this->build_print();
    
    // (5) We have all the parts build the make file
    
	if( proj_ok )
	{
		if( this->build_make(pgmid,compiler,cc_opt,linker,link_opt, bin_dir) )
			return( true );
	}
    else
	{
		printf("** BAD PROJECT FILE FIX AND TRY AGAIN\n");
        return( false );
	}
................................................................................
/***********************************************************************
*
*   bool build_make( char *compiler )	- Build the makefile 
*
*	INPUT:	pgmid		- Creator pogram ID
*			compiler	- String name of compiler
*			cc_opt		- Compiler options
*			linker		- Linker name
*			link_opt	- Linker options
*
*	OUTPUT:	TRUE if makefile OK, FALSE if not
*
*  13-Oct-2006 Change here to specify object file lcn
*
***********************************************************************/

bool CMaker::build_make( char *id,
						char *compiler,char *cc_opt,
						char *linker,char *link_opt, 
						char *bin_dir)
{
    FILE_LIST *fl;
	time_t t;
	char buf[32];
	int n;
	int count = 1;
	bool first = true;
................................................................................
    fprintf(make,"\n");
    fprintf(make,"#\n");
    fprintf(make,"# Macros\n");
    fprintf(make,"#\n");
    fprintf(make,"\n");
    fprintf(make,"CC = %s\n",compiler);
    fprintf(make,"CC_OPTIONS = %s\n",cc_opt);
	fprintf(make,"LINKER = %s\n",linker);
	
	this->linker_line(link_opt);

    // (2) Trim the paths from the include file list
    // and build the INCLUDE macro
    
	fprintf(make,"\n");
................................................................................
		}
        fl = fl->next;
    }
    fprintf(make,"\n");			// Terminate the section
								// NOTE: Remove extra LF between this and 
								// compile line REF:JS03112006

    fprintf(make,"\t$(LINKER) $(LNK_OPTIONS) \\\n");// REF:JS06032004 alone on line
    fl = cfiles;

	// Loop for all the o files
	
    while( fl != NULL )
    {
		if( target_files->check(fl->name))

Changes to CMaker.h.

99
100
101
102
103
104
105

106
107
108
109
110
111
112
113
114
115
116
117
118

119
120
121
122
123
124
125
...
127
128
129
130
131
132
133
134



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
...
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
} FILE_LIST;


/************************************************************
*		OBJECT DEFS
************************************************************/


class CMaker {

	public:
            CMaker(	CpbxLexFile *p,
					FILE *out, 
					bool debug_f,
					bool framework_f,
					char *target_name,
					char *obj_name );// Start it up
			bool parse();								// Parse the input file
			bool build( char *pgmid,
						char *compiler,
						char *cc_opt,

						char *link_opt, 
						char *bin_dir);
            ~CMaker(void);								// Tidy up
            
	private:

	
................................................................................
		void parseline(int type,char *token);			// Init line parser
		void gatherline();								// Look for file info
		void storeline();
	
		void clrkvp();									// Init kvp
		bool getkvp(int type,char *token);				// Return KVP's from list

		bool build_make(char *pgmid,char *compiler,char *cc_opt,char *link_opt, char *bin_dir);



		void linker_line( char *lnk_opts );				// REF:JS16032002 
		void build_print();						// Print file and include list
        
        void trim_files( FILE_LIST *list );
        void trim_file( FILE_LIST *list );
        FILE_LIST *trim_paths( FILE_LIST *list );
		
		char *getfname( char *path );
		char *getfpath( char *path );
		
		// *** Local vars
    
		char comp[256];			// Compiler name
        CpbxLexFile *base;			// Base of Descriptor struct
        FILE *make;				// Make file output pointer
		
		FILE_LIST *pgmid;		// EXE file data
        FILE_LIST *cfiles;		// Internal list of C files
        FILE_LIST *includes;	// Internal list of .h files
        FILE_LIST *libs;		// Internal list of libraries
................................................................................

		// KVP state & data
		KEY_VALUE	kvp;		// Current KVP
		/// Line state & data
		LINE_VALUE	line;
		// File data
		FILE_LIST	file;		// File element state
		char namestore[256];
		char pathstore[256];
		
		// REF:JS10102006 Change here to help support dylibs
		// These are the extra link options needed to support them
		
		bool dylib_flag;	// Mark as TRUE if we are build a dylib
		
		// REF:JS12102006 Add target name to specify a build target







>













>







 







|
>
>
>












|







 







|
|







99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
...
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
...
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
} FILE_LIST;


/************************************************************
*		OBJECT DEFS
************************************************************/

#define NAME_SIZES	1024
class CMaker {

	public:
            CMaker(	CpbxLexFile *p,
					FILE *out, 
					bool debug_f,
					bool framework_f,
					char *target_name,
					char *obj_name );// Start it up
			bool parse();								// Parse the input file
			bool build( char *pgmid,
						char *compiler,
						char *cc_opt,
						char *linker,
						char *link_opt, 
						char *bin_dir);
            ~CMaker(void);								// Tidy up
            
	private:

	
................................................................................
		void parseline(int type,char *token);			// Init line parser
		void gatherline();								// Look for file info
		void storeline();
	
		void clrkvp();									// Init kvp
		bool getkvp(int type,char *token);				// Return KVP's from list

		bool build_make(char *pgmid,
						char *compiler,char *cc_opt,
						char *linker,char *link_opt, 
						char *bin_dir);
		void linker_line( char *lnk_opts );				// REF:JS16032002 
		void build_print();						// Print file and include list
        
        void trim_files( FILE_LIST *list );
        void trim_file( FILE_LIST *list );
        FILE_LIST *trim_paths( FILE_LIST *list );
		
		char *getfname( char *path );
		char *getfpath( char *path );
		
		// *** Local vars
    
		char comp[NAME_SIZES];			// Compiler name
        CpbxLexFile *base;			// Base of Descriptor struct
        FILE *make;				// Make file output pointer
		
		FILE_LIST *pgmid;		// EXE file data
        FILE_LIST *cfiles;		// Internal list of C files
        FILE_LIST *includes;	// Internal list of .h files
        FILE_LIST *libs;		// Internal list of libraries
................................................................................

		// KVP state & data
		KEY_VALUE	kvp;		// Current KVP
		/// Line state & data
		LINE_VALUE	line;
		// File data
		FILE_LIST	file;		// File element state
		char namestore[NAME_SIZES];
		char pathstore[NAME_SIZES];
		
		// REF:JS10102006 Change here to help support dylibs
		// These are the extra link options needed to support them
		
		bool dylib_flag;	// Mark as TRUE if we are build a dylib
		
		// REF:JS12102006 Add target name to specify a build target

Changes to main.cp.

41
42
43
44
45
46
47

48
49
50
51
52
53
54
55
56
57


58
59
60
61
62
63
64
..
77
78
79
80
81
82
83

84
85
86
87
88
89
90
..
96
97
98
99
100
101
102

103
104
105
106
107
108
109
...
134
135
136
137
138
139
140





141
142
143
144
145
146
147
...
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
...
242
243
244
245
246
247
248

249
250
251
252
253
254
255
256
257
258
259
*		1.3A	05-May-2006		F.Wagner		Add generation of		*
*												"clean" and "install"	*
*												section.				*
*												Add BIN_DIR option		*
*		1.4		12-Oct-2006		J.Schimpf		Specify target in multi	*
*												target projects			*
*		1.5		13-Oct-2006		J.Schimpf		Add object file lcn		*

*																		*
*	DESCRIPTION:														*
*		This will take a pbxproj file extracted from a ProjectBuilder	*
*	project and turn it into a simple make file	which can be used in 	*
*	Linux																*
*	SYNTAX:	pbtomake -i <name>.xcodeproj [-o <makefile name>] [-v]		*
*				-i <name>.xcodeproj	- Project file NO DEFAULT			*
*				[-o <makefile>]		- Output makefile DEF = makefile	*
*				[-cc compiler]		- User compiler selection			*
*										DEF = /usr/bin/cc				*


*				[-cc_opt <options>]	- CC options						*
*				[-link_opt <options]- Link options						*
*				[-bin_dir target_dir]- target dir for install			*
*				[-no_framwork]		- Supress frameworks in makefile	*
*				[-t Target]			- Specify build target for project	*
*									  with multiple targets				*
*				[-obj OBJ location	- Store .o files here				*
................................................................................
//#include "CPBPROJ.h"
#include "CMaker.h"

/******* Local Definitions ******/

#define DEF_OUTPUT_FILE	(char *)"makefile"
#define DEF_COMPILER	(char *)"/usr/bin/gcc"

#define DEF_CCOPT		(char *)""
#define DEF_LINKOPT		(char *)""
#define DEF_BINDIR		(char *)""
#define DEF_OBJDIR		(char *)"."

/******* Local Functions ******/

................................................................................
	FILE *out;
	char *ptr;
	CpbxLexFile *in;
	char msg[256];
	//CPbxProj *proj;
    CMaker *make;
	char *compiler;			// REF:JS15032003

	char *cc_opt;			// REF:JS31072005
	char *lnk_opt;			// REF:JS31072005
	char *bin_dir;
    char inproj[256];
	char pgmid[256];		// REF:JS16032003
	bool debug = false;
	bool framework_f = true;// REF:JS12032006
................................................................................
		ptr = NULL;
	}

	if( !flag_srch(argc,argv,"-cc",TRUE,&compiler))	// Compiler
	{
		compiler = DEF_COMPILER;
	}






	if( !flag_srch(argc,argv,"-cc_opt",TRUE,&cc_opt))	// Compiler options
	{
		cc_opt = DEF_CCOPT;
	}

	if( !flag_srch(argc,argv,"-link_opt",TRUE,&lnk_opt))	// Link options
................................................................................
		error_exit(msg);
	}
	
	make = new CMaker( in, out,debug,framework_f,target,obj );
	sprintf(pgmid,"Xcode -> Makefile Ver: %s %s",__DATE__,__TIME__);
	if( make->parse() )
	{
		make->build(pgmid,compiler,cc_opt,lnk_opt, bin_dir);
	}
	else
	{
		printf("** Parse failed **\n");
	}
	delete make;
		
................................................................................
void dump_pgmdir( void )
{
	printf("pbtomake PB Project -> makefile converter Ver: %s %s\n",__DATE__,__TIME__);
	printf("\tSyntax pbtomake -i <Project.pbproj> [-o <fname>] [-cc <c compiler>] [-v]\n");
	printf("\t\t-i <fname>\tInput Project (pbproj) DEF NONE\n");
	printf("\t\t-o <fname>\tOutput File (makefile)   DEF makefile\n");
	printf("\t\t-cc <compiler>\tCompiler used DEF /usr/bin/gcc\n");

	printf("\t\t-cc_opt <compiler optons>\tCompiler options DEF NONE\n");
	printf("\t\t-bin_dir <install directory>\tTarget directory for\n");
	printf("\t\t\t\t\t\t\"make install\" DEF NONE\n");	
	printf("\t\t-obj <Object directory>\tObject file directory DEF = \".\"\n");
	printf("\t\t-link_opt <link options>\tLink stage options DEF NONE\n");
	printf("\t\t-no_framework\tSupress -framework lines DEF Show frameworks\n");
	printf("\t\t-t <target>\tSpecify target name in multi-target Project files\n");
	printf("\t\t-debug\t\tTurn on Debug output\n");
	printf("\t\t-v\t\tShow this help\n");
	printf("\n");
}







>









|
>
>







 







>







 







>







 







>
>
>
>
>







 







|







 







>











41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
..
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
...
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
...
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
...
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
...
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
*		1.3A	05-May-2006		F.Wagner		Add generation of		*
*												"clean" and "install"	*
*												section.				*
*												Add BIN_DIR option		*
*		1.4		12-Oct-2006		J.Schimpf		Specify target in multi	*
*												target projects			*
*		1.5		13-Oct-2006		J.Schimpf		Add object file lcn		*
*		1.6		23-Jul-2012		J.Schimpf		Add linker pgm cmd		*
*																		*
*	DESCRIPTION:														*
*		This will take a pbxproj file extracted from a ProjectBuilder	*
*	project and turn it into a simple make file	which can be used in 	*
*	Linux																*
*	SYNTAX:	pbtomake -i <name>.xcodeproj [-o <makefile name>] [-v]		*
*				-i <name>.xcodeproj	- Project file NO DEFAULT			*
*				[-o <makefile>]		- Output makefile DEF = makefile	*
*				[-cc compiler]		- User compiler selection			*
*										DEF = /usr/bin/gcc				*
*				[-linker linker]	- User linker selection				*
*										DEF = /usr/bin/gcc				*
*				[-cc_opt <options>]	- CC options						*
*				[-link_opt <options]- Link options						*
*				[-bin_dir target_dir]- target dir for install			*
*				[-no_framwork]		- Supress frameworks in makefile	*
*				[-t Target]			- Specify build target for project	*
*									  with multiple targets				*
*				[-obj OBJ location	- Store .o files here				*
................................................................................
//#include "CPBPROJ.h"
#include "CMaker.h"

/******* Local Definitions ******/

#define DEF_OUTPUT_FILE	(char *)"makefile"
#define DEF_COMPILER	(char *)"/usr/bin/gcc"
#define DEF_LINKER		(char *)"/usr/bin/gcc"
#define DEF_CCOPT		(char *)""
#define DEF_LINKOPT		(char *)""
#define DEF_BINDIR		(char *)""
#define DEF_OBJDIR		(char *)"."

/******* Local Functions ******/

................................................................................
	FILE *out;
	char *ptr;
	CpbxLexFile *in;
	char msg[256];
	//CPbxProj *proj;
    CMaker *make;
	char *compiler;			// REF:JS15032003
	char *linker;			// REF:6519ea274e	
	char *cc_opt;			// REF:JS31072005
	char *lnk_opt;			// REF:JS31072005
	char *bin_dir;
    char inproj[256];
	char pgmid[256];		// REF:JS16032003
	bool debug = false;
	bool framework_f = true;// REF:JS12032006
................................................................................
		ptr = NULL;
	}

	if( !flag_srch(argc,argv,"-cc",TRUE,&compiler))	// Compiler
	{
		compiler = DEF_COMPILER;
	}
	
	if( !flag_srch(argc,argv,"-linker",TRUE,&linker))	// Linker
	{
		linker = DEF_LINKER;
	}

	if( !flag_srch(argc,argv,"-cc_opt",TRUE,&cc_opt))	// Compiler options
	{
		cc_opt = DEF_CCOPT;
	}

	if( !flag_srch(argc,argv,"-link_opt",TRUE,&lnk_opt))	// Link options
................................................................................
		error_exit(msg);
	}
	
	make = new CMaker( in, out,debug,framework_f,target,obj );
	sprintf(pgmid,"Xcode -> Makefile Ver: %s %s",__DATE__,__TIME__);
	if( make->parse() )
	{
		make->build(pgmid,compiler,cc_opt,linker,lnk_opt, bin_dir);
	}
	else
	{
		printf("** Parse failed **\n");
	}
	delete make;
		
................................................................................
void dump_pgmdir( void )
{
	printf("pbtomake PB Project -> makefile converter Ver: %s %s\n",__DATE__,__TIME__);
	printf("\tSyntax pbtomake -i <Project.pbproj> [-o <fname>] [-cc <c compiler>] [-v]\n");
	printf("\t\t-i <fname>\tInput Project (pbproj) DEF NONE\n");
	printf("\t\t-o <fname>\tOutput File (makefile)   DEF makefile\n");
	printf("\t\t-cc <compiler>\tCompiler used DEF /usr/bin/gcc\n");
	printf("\t\t-linker <Linker>\\Linker used DEF /usr/bin/gcc\n");
	printf("\t\t-cc_opt <compiler optons>\tCompiler options DEF NONE\n");
	printf("\t\t-bin_dir <install directory>\tTarget directory for\n");
	printf("\t\t\t\t\t\t\"make install\" DEF NONE\n");	
	printf("\t\t-obj <Object directory>\tObject file directory DEF = \".\"\n");
	printf("\t\t-link_opt <link options>\tLink stage options DEF NONE\n");
	printf("\t\t-no_framework\tSupress -framework lines DEF Show frameworks\n");
	printf("\t\t-t <target>\tSpecify target name in multi-target Project files\n");
	printf("\t\t-debug\t\tTurn on Debug output\n");
	printf("\t\t-v\t\tShow this help\n");
	printf("\n");
}

Changes to pbtomake.xcodeproj/project.pbxproj.

189
190
191
192
193
194
195



196
197
198
199
200
201
202
...
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
...
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
			productType = "com.apple.product-type.tool";
		};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
		08FB7793FE84155DC02AAC07 /* Project object */ = {
			isa = PBXProject;



			buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "pbtomake" */;
			compatibilityVersion = "Xcode 3.2";
			developmentRegion = English;
			hasScannedForEncodings = 1;
			knownRegions = (
				en,
			);
................................................................................
/* Begin XCBuildConfiguration section */
		1DEB923208733DC60010E9CD /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				"ARCHS[sdk=*]" = "$(NATIVE_ARCH)";
				COPY_PHASE_STRIP = NO;
				GCC_DYNAMIC_NO_PIC = NO;
				GCC_ENABLE_FIX_AND_CONTINUE = YES;
				GCC_MODEL_TUNING = G5;
				GCC_OPTIMIZATION_LEVEL = 0;
				INSTALL_PATH = "$(HOME)/bin";
				PRODUCT_NAME = pbtomake;
				ZERO_LINK = YES;
			};
			name = Debug;
................................................................................
		};
		1DEB923608733DC60010E9CD /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
				GCC_WARN_ABOUT_RETURN_TYPE = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				PREBINDING = NO;
			};
			name = Debug;
		};
		1DEB923708733DC60010E9CD /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				GCC_WARN_ABOUT_RETURN_TYPE = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				PREBINDING = NO;
			};
			name = Release;
		};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
		1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "pbtomake" */ = {







>
>
>







 







<







 







<








<







189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
...
235
236
237
238
239
240
241

242
243
244
245
246
247
248
...
263
264
265
266
267
268
269

270
271
272
273
274
275
276
277

278
279
280
281
282
283
284
			productType = "com.apple.product-type.tool";
		};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
		08FB7793FE84155DC02AAC07 /* Project object */ = {
			isa = PBXProject;
			attributes = {
				LastUpgradeCheck = 0430;
			};
			buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "pbtomake" */;
			compatibilityVersion = "Xcode 3.2";
			developmentRegion = English;
			hasScannedForEncodings = 1;
			knownRegions = (
				en,
			);
................................................................................
/* Begin XCBuildConfiguration section */
		1DEB923208733DC60010E9CD /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				"ARCHS[sdk=*]" = "$(NATIVE_ARCH)";
				COPY_PHASE_STRIP = NO;
				GCC_DYNAMIC_NO_PIC = NO;

				GCC_MODEL_TUNING = G5;
				GCC_OPTIMIZATION_LEVEL = 0;
				INSTALL_PATH = "$(HOME)/bin";
				PRODUCT_NAME = pbtomake;
				ZERO_LINK = YES;
			};
			name = Debug;
................................................................................
		};
		1DEB923608733DC60010E9CD /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
				GCC_WARN_ABOUT_RETURN_TYPE = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;

			};
			name = Debug;
		};
		1DEB923708733DC60010E9CD /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				GCC_WARN_ABOUT_RETURN_TYPE = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;

			};
			name = Release;
		};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
		1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "pbtomake" */ = {

Changes to pbtomake.xcodeproj/project.xcworkspace/xcuserdata/jim.xcuserdatad/UserInterfaceState.xcuserstate.

cannot compute difference between binary files

Changes to pbtomake.xcodeproj/xcuserdata/jim.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist.

5
6
7
8
9
10
11
12
13
14
15
16













17
18
19
20
21
   <FileBreakpoints>
      <FileBreakpoint
         shouldBeEnabled = "Yes"
         ignoreCount = "0"
         continueAfterRunningActions = "No"
         isPathRelative = "1"
         filePath = "main.cp"
         timestampString = "290435173.099373"
         startingColumnNumber = "9223372036854775807"
         endingColumnNumber = "9223372036854775807"
         startingLineNumber = "116"
         endingLineNumber = "116"













         landmarkName = "main(int argc,char **argv)"
         landmarkType = "7">
      </FileBreakpoint>
   </FileBreakpoints>
</Bucket>







|


|
|
>
>
>
>
>
>
>
>
>
>
>
>
>





5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
   <FileBreakpoints>
      <FileBreakpoint
         shouldBeEnabled = "Yes"
         ignoreCount = "0"
         continueAfterRunningActions = "No"
         isPathRelative = "1"
         filePath = "main.cp"
         timestampString = "364744863.269973"
         startingColumnNumber = "9223372036854775807"
         endingColumnNumber = "9223372036854775807"
         startingLineNumber = "121"
         endingLineNumber = "121"
         landmarkName = "main(int argc,char **argv)"
         landmarkType = "7">
      </FileBreakpoint>
      <FileBreakpoint
         shouldBeEnabled = "No"
         ignoreCount = "0"
         continueAfterRunningActions = "No"
         filePath = "main.cp"
         timestampString = "364744861.258538"
         startingColumnNumber = "9223372036854775807"
         endingColumnNumber = "9223372036854775807"
         startingLineNumber = "211"
         endingLineNumber = "211"
         landmarkName = "main(int argc,char **argv)"
         landmarkType = "7">
      </FileBreakpoint>
   </FileBreakpoints>
</Bucket>

Changes to pbtomake.xcodeproj/xcuserdata/jim.xcuserdatad/xcschemes/pbtomake.xcscheme.

1
2

3
4
5
6
7
8
9
..
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
..
45
46
47
48
49
50
51




52
53
54
55
56
57
58
59
60
<?xml version="1.0" encoding="UTF-8"?>
<Scheme

   version = "1.3">
   <BuildAction
      parallelizeBuildables = "YES"
      buildImplicitDependencies = "YES">
      <BuildActionEntries>
         <BuildActionEntry
            buildForTesting = "YES"
................................................................................
      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
      shouldUseLaunchSchemeArgsEnv = "YES"
      buildConfiguration = "Debug">
      <Testables>
      </Testables>
   </TestAction>
   <LaunchAction
      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
      launchStyle = "0"
      useCustomWorkingDirectory = "NO"
      buildConfiguration = "Debug"
      ignoresPersistentStateOnLaunch = "NO"
      debugDocumentVersioning = "YES"
      allowLocationSimulation = "YES">
      <BuildableProductRunnable>
................................................................................
            BuildableName = "pbtomake"
            BlueprintName = "pbtomake"
            ReferencedContainer = "container:pbtomake.xcodeproj">
         </BuildableReference>
      </BuildableProductRunnable>
      <CommandLineArguments>
         <CommandLineArgument




            argument = "-i ../../TEST/Firenet.xcodeproj -obj obj"
            isEnabled = "YES">
         </CommandLineArgument>
      </CommandLineArguments>
      <AdditionalOptions>
      </AdditionalOptions>
   </LaunchAction>
   <ProfileAction
      shouldUseLaunchSchemeArgsEnv = "YES"


>







 







|
|







 







>
>
>
>

|







1
2
3
4
5
6
7
8
9
10
..
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
..
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
   LastUpgradeVersion = "0430"
   version = "1.3">
   <BuildAction
      parallelizeBuildables = "YES"
      buildImplicitDependencies = "YES">
      <BuildActionEntries>
         <BuildActionEntry
            buildForTesting = "YES"
................................................................................
      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
      shouldUseLaunchSchemeArgsEnv = "YES"
      buildConfiguration = "Debug">
      <Testables>
      </Testables>
   </TestAction>
   <LaunchAction
      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
      launchStyle = "0"
      useCustomWorkingDirectory = "NO"
      buildConfiguration = "Debug"
      ignoresPersistentStateOnLaunch = "NO"
      debugDocumentVersioning = "YES"
      allowLocationSimulation = "YES">
      <BuildableProductRunnable>
................................................................................
            BuildableName = "pbtomake"
            BlueprintName = "pbtomake"
            ReferencedContainer = "container:pbtomake.xcodeproj">
         </BuildableReference>
      </BuildableProductRunnable>
      <CommandLineArguments>
         <CommandLineArgument
            argument = "-i BoardCom.xcodeproj -obj obj -cc g++ -cc_opt -D_cplusplus=1 -linker clang++"
            isEnabled = "YES">
         </CommandLineArgument>
         <CommandLineArgument
            argument = "-i ../../TEST/Firenet.xcodeproj -obj obj"
            isEnabled = "NO">
         </CommandLineArgument>
      </CommandLineArguments>
      <AdditionalOptions>
      </AdditionalOptions>
   </LaunchAction>
   <ProfileAction
      shouldUseLaunchSchemeArgsEnv = "YES"