Makefile across platforms


 
Thread Tools Search this Thread
Top Forums Programming Makefile across platforms
# 1  
Old 09-15-2004
Question Makefile across platforms

[CODE]
EXE=auto
SRCS=auto.cpp debug.cpp
OBJS=auto.o debug.o

CXX=g++

#HOSTFLAG=-DLinux
HOSTFLAG=-DSunOS

# Do not use compiler optimizer -O as this may break the program
# Use debug flag to enable the debug() function. If DEBUG is not
# defined than the function debug() is set to void(), similar
# to assert()
# Use options -Wall (all warning msgs) -O3 (optimization)
MYCFLAGS=-DDEBUG -g -Wall
#MYCFLAGS=-O3 -Wall

all: $(OBJS)
$(CXX) $(HOSTFLAG) $(MYCFLAGS) $(OBJS) -o $(EXE)

$(OBJS): $(SRCS)
$(CXX) -c $(HOSTFLAG) $(MYCFLAGS) $(SRCS)

clean:
rm -f *.o *.log *.log.old *.pid core err a.out afiedt.buf
rm -f $(EXE)

[CODE/]

i would like to modify this Makefile so that it could be used across platform and procudes appropriate executable for each platform. I've never done anything like this before so please help me. this is an urgent need.

Thank you in advance.
# 2  
Old 09-17-2004
Thank you so much, that helped a lot!

cheers! (it's the weekend) Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Multichecks across all unix platforms

Can somebody refer me following multicheck to perform across most of unix platform like AIX, HP-UX, solaris, Linux. CPU utilization above X% Check IO above X% Swap usage check above X% Memory utilization above X% ... (3 Replies)
Discussion started by: sendtoshailesh
3 Replies

2. Homework & Coursework Questions

Help with Simple Multi-Level Makefile (Extremely New at Makefile)

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Basically, the prompt is make a makefile with various sub makefiles in their respective subdirectories. All code... (1 Reply)
Discussion started by: Tatl
1 Replies

3. UNIX for Advanced & Expert Users

Makefile executing another Makefile first?

I have 2 libraries in 2 different directories that I build with Makefiles. library B depends on library A. If I modify a .cpp file in library A and run lib B's Makefile can I have B's makefile to automatically rebuild library A? I am now rebuilding A, followed by B... but I'd like B to... (0 Replies)
Discussion started by: wwuster
0 Replies

4. UNIX and Linux Applications

Platforms using Unix

Hi ;) Which hardware platforms/machine types use the Operating System Unix? A list of all would be appreaciated Thx Megadrink :cool: (2 Replies)
Discussion started by: Megadrink
2 Replies

5. UNIX for Dummies Questions & Answers

Unix Platforms

Hi. Where can i learn, Which Unix platform specific for what? Properties? (1 Reply)
Discussion started by: Enrgy
1 Replies

6. UNIX for Advanced & Expert Users

Makefile problem - How to run module load in a Makefile

Hi, I'm trying to run the module load command in a Makefile and i'm getting the following error: make: module: command not found Why is this? Is there any way to run this command in a Makefile? NOTE: command - module load msjava/sunjdk/1.5.0 works fine outside of the Makefile (2 Replies)
Discussion started by: hernandinho
2 Replies

7. Solaris

Different Platforms on Solaris?

Does anyone know how Solaris organises different platforms? (1 Reply)
Discussion started by: gc40
1 Replies

8. UNIX for Dummies Questions & Answers

zipping across platforms

I saw a few posts on this, however, I am getting an error and don't see this particular issue. Not right off anyways.... We moved from digital OS to solaris 9 in Jan. On the old platform, I could gzip my files, ftp them to my win2000 desktop via hummingbird and then unzip them to view. Now,... (8 Replies)
Discussion started by: MizzGail
8 Replies

9. UNIX for Dummies Questions & Answers

what do one mean when referring to 'platforms'?

what do one mean when referring to 'platforms'? (examples of platforms as listed below) alpha amd64 i386 ia64 pc98 sparc64 Thanks! (1 Reply)
Discussion started by: ninelives1980
1 Replies

10. Linux

Reading files on different platforms

How can I read a file that is created in linux wordprocessor on a winxp platform and vice versa without losing the original format fo the document. Do I need an emulator of some sort to be able to do this? Secondly, Im trying to do a screen shot or a screen dump in linux wordprocessor but I cant... (2 Replies)
Discussion started by: BigTool4u2
2 Replies
Login or Register to Ask a Question