In the following Makefile, it assumes that your testing program is named loop.

CC = /p/compiler2/xiaoming/csc455/bin/bin/gcc

TARGET = loop
SOURCE = $(TARGET).c
OBJECT = $(TARGET).o
BINARY = $(TARGET)
LIB = cs255-lib
LIB_SOURCE = $(LIB).c
LIB_OBJECT = $(LIB).o
 
OPT = -O2
CS255 = -fcs255
DUMP_GIMPLE = -fdump-tree-gimple
DUMP_CS255_GIMPLE = -fdump-cs255-tree-gimple

$(BINARY): $(OBJECT) $(LIB_OBJECT)
    $(CC) $(OBJECT) $(LIB_OBJECT) -o $(BINARY)
 
$(OBJECT): $(SOURCE)
    $(CC) $(OPT) $(CS255) $(DUMP_CS255_GIMPLE) $(SOURCE) -c -o $(OBJECT)

$(LIB_OBJECT): $(LIB_SOURCE)
    $(CC) $(OPT) $(LIB_SOURCE) -c -o $(LIB_OBJECT)

clean:
    -rm -rf $(BINARY) $(OBJECT) $(LIB_OBJECT)

-- XiaomingGu - 27 Jan 2008


This topic: Main > TWikiUsers > ChenDing > CS255Spring08 > ProjectHome > MakefileExample
Topic revision: r5 - 2008-02-12 - JonathanGordon
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding URCS? Send feedback