public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Makefile help request
@ 2007-12-06 22:15 Robert Wong
  2007-12-07  0:35 ` Tom Browder
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Wong @ 2007-12-06 22:15 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 733 bytes --]

Question 1:
I am trying to establish the following dependencies in the attached Makefile
(currently, make executes every command in the makefile):

- for MCSIM_CPP files if there is a change to any .cpp file, re-compile that
specific file(s) to .o
- for DRAMSIM_C files if there is a change to any .c file, re-compile that
specific file(s) to .o (Note: there is 1 .cpp file in this set -
memory-dram.cpp)
- I tried to establish some macros (DRAMSIM_C, DRAMSIM_OBJS, MCSIM_CPP,
MCSIM_OBJS) but make doesn't seem to recognize unless I list all the files
manually.


Question 2:
If use the following line:
G++ -c mem.c mem.h dram.h

Is it the same as:
G++ -c mem.c mem.h
(assuming that #include "dram.h" is in mem.h?)

Thanks, 
Robert


[-- Attachment #2: Makefile-all1.c --]
[-- Type: application/octet-stream, Size: 4092 bytes --]

##    DEFINE THE ROOT AND THE LIBRARIES
TARGET = SESC_DRIVER
BUILD_DIR = /tmp/DRAMsim-12/

##    DO NOT TOUCH BELOW THIS LINE
CC     = g++	
OPT    = -O2	
DEBUG  = -g
OTHER = -O6 -mcpu=i686 -malign-double -funroll-all-loops\
                 -ffast-math -fno-exceptions

CFLAGS =  $(DEBUG) -mcpu=i686
INCLUDE = -I$(BUILD_DIR)

DRAMSIM_OBJS = $(DRAMSIM_C:.c=.o)
MCSIM_OBJS = $(MCSIM_CPP:.cpp=.o)

default : $(TARGET)

#all : mcsim mem-biu.o mem-stat.o mem-dram.o mem-statemachine.o mem-address.o mem-dram-helper.o mem-commandissuetest.o mem-fileio.o mem-transactions.o mem-bundle.o mem-amb-buffer.o mem-refresh.o mem-issuecommands.o mem-dram-power.o mem-dram-mcsim-interface.o $(TARGET)

$(TARGET): mcsim mem-biu.o mem-stat.o mem-dram.o mem-statemachine.o mem-address.o mem-dram-helper.o mem-commandissuetest.o mem-fileio.o mem-transactions.o mem-bundle.o mem-amb-buffer.o mem-refresh.o mem-issuecommands.o mem-dram-power.o mem-dram-mcsim-interface.o memory-dram.o
	$(CC) $(CFLAGS) -o $(TARGET) $(MCSIM_OBJS) $(DRAMSIM_OBJS) memory-dram.o $(INCLUDE)

mcsim : SESC_NOC_interface.cpp CentralPageHandler.cpp CentralMemorySystem.cpp SockMonitor.cpp Socket.cpp Snippets.cpp main.cpp MsgQueue.cpp SockMsg.cpp MemMsg.cpp L2Cache.cpp NoCInterface.cpp cache.cpp directorycache.cpp NetMsgBuffer.cpp RouterAssignment.cpp simplenoc.cpp CommonTimeStampMsg.cpp
	$(CC) $(CFLAGS) -c $(MCSIM_CPP) $(INCLUDE)
	
mem-fileio.o : mem-fileio.c mem-tokens.h mem-system.h
	$(CC) $(CFLAGS)  -c mem-fileio.c mem-tokens.h mem-system.h
mem-dram.o : mem-dram.c mem-system.h mem-biu.h
	$(CC) $(CFLAGS)  -c mem-dram.c mem-system.h mem-biu.h
mem-dram-helper.o: mem-dram-helper.c mem-system.h mem-biu.h	
	$(CC) $(CFLAGS)  -c mem-dram-helper.c mem-system.h mem-biu.h 
mem-dram-power.o: mem-dram-power.c mem-system.h
	$(CC) $(CFLAGS)  -c mem-dram-power.c mem-system.h
mem-commandissuetest.o: mem-commandissuetest.c mem-system.h mem-biu.h	
	$(CC) $(CFLAGS)  -c mem-commandissuetest.c mem-system.h mem-biu.h
mem-statemachine.o:  mem-statemachine.c mem-commandissuetest.c mem-system.h	
	$(CC) $(CFLAGS)  -c mem-statemachine.c mem-commandissuetest.c mem-system.h
mem-bundle.o: mem-bundle.c mem-system.h mem-biu.h
	$(CC) $(CFLAGS)  -c mem-bundle.c mem-system.h mem-biu.h
mem-biu.o: mem-biu.c mem-system.h mem-biu.h
	$(CC) $(CFLAGS)  -c mem-biu.c mem-system.h mem-biu.h
mem-stat.o: mem-stat.c mem-system.h mem-biu.h
	$(CC) $(CFLAGS)  -c mem-stat.c mem-system.h mem-biu.h
mem-refresh.o: mem-refresh.c mem-system.h mem-biu.h
	$(CC) $(CFLAGS)  -c mem-refresh.c mem-system.h mem-biu.h
mem-issuecommands.o: mem-issuecommands.c mem-system.h
	$(CC) $(CFLAGS)  -c mem-issuecommands.c mem-system.h
mem-address.o: mem-address.c mem-system.h
	$(CC) $(CFLAGS)  -c mem-address.c mem-system.h
mem-transactions.o: mem-transactions.c mem-system.h mem-biu.h
	$(CC) $(CFLAGS)  -c mem-transactions.c mem-system.h mem-biu.h
mem-amb-buffer.o: mem-amb-buffer.c mem-system.h mem-biu.h
	$(CC) $(CFLAGS) -c mem-amb-buffer.c mem-system.h mem-biu.h	
memory-dram.o : memory-dram.cpp memory-dram.h mem-dram-mcsim-interface.h
	$(CC) $(CFLAGS) -c memory-dram.cpp memory-dram.h mem-dram-mcsim-interface.h
mem-dram-mcsim-interface.o: mem-dram-mcsim-interface.c mem-dram-mcsim-interface.h mem-system.h mem-biu.h
	$(CC) $(CFLAGS) -c mem-dram-mcsim-interface.c mem-dram-mcsim-interface.h mem-system.h mem-biu.h
	
# source files
##############################################################################
MCSIM_CPP = SESC_NOC_interface.cpp CentralPageHandler.cpp CentralMemorySystem.cpp SockMonitor.cpp Socket.cpp Snippets.cpp main.cpp MsgQueue.cpp SockMsg.cpp MemMsg.cpp L2Cache.cpp NoCInterface.cpp cache.cpp directorycache.cpp NetMsgBuffer.cpp RouterAssignment.cpp simplenoc.cpp CommonTimeStampMsg.cpp 
   
DRAMSIM_C = mem-biu.c mem-stat.c mem-dram.c mem-statemachine.c mem-address.c mem-dram-helper.c mem-commandissuetest.c mem-fileio.c mem-transactions.c mem-bundle.c mem-amb-buffer.c mem-refresh.c mem-issuecommands.c mem-dram-power.c mem-dram-mcsim-interface.c
##############################################################################

clean: 
	rm $(TARGET)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-12-29 17:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-06 22:15 Makefile help request Robert Wong
2007-12-07  0:35 ` Tom Browder
2007-12-29 17:37   ` Makefile help request (config file) Robert Wong
2007-12-29 17:42     ` FW: " Robert Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).