From: Robert Wong <subdriver97@gmail.com>
To: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Makefile help request
Date: Thu, 06 Dec 2007 22:15:00 -0000 [thread overview]
Message-ID: <C37DB48C.2190%subdriver97@gmail.com> (raw)
[-- 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)
next reply other threads:[~2007-12-06 22:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-06 22:15 Robert Wong [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C37DB48C.2190%subdriver97@gmail.com \
--to=subdriver97@gmail.com \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).