Subversion Repositories Programming Utils

Rev

Rev 45 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#
# Created by gmakemake x86 (Jan 28 2013) on Mon Jan 28 13:49:26 2013
#

#
# Definitions
#

.SUFFIXES:
.SUFFIXES:      .a .o .c .C .cpp .s .S
.c.o:
                $(COMPILE.c) $< -o $@
.C.o:
                $(COMPILE.cc) $< -o $@
.cpp.o:
                $(COMPILE.cc) $< -o $@
.S.s:
                $(CPP) -o $*.s $<
.s.o:
                $(COMPILE.cc) $< -o $@
.c.a:
                $(COMPILE.c) -o $% $<
                $(AR) $(ARFLAGS) $@ $%
.C.a:
                $(COMPILE.cc) -o $% $<
                $(AR) $(ARFLAGS) $@ $%
.cpp.a:
                $(COMPILE.cc) -o $% $<
                $(AR) $(ARFLAGS) $@ $%

CC =            gcc
CXX =           g++

RM = rm -f
AR = ar
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c

########## Default flags (redefine these with a header.mak file if desired)
CPPFLAGS = 
CXXFLAGS =      -ggdb
CFLAGS =        -ggdb
CLIBFLAGS =     -lm
CCLIBFLAGS =    -lpthread
########## End of default flags


CPP_FILES =     MakefileObject.cpp dirlist.cpp makemake.cpp write.cpp
C_FILES =       
PS_FILES =       
S_FILES =       
H_FILES =       MakefileObject.h PlatformSwitcher.h dirlist.h write.h
SOURCEFILES =   $(H_FILES) $(CPP_FILES) $(C_FILES) $(S_FILES)
.PRECIOUS:      $(SOURCEFILES)
OBJFILES =      MakefileObject.o dirlist.o write.o 

#
# Main targets
#

all:    makemake 

makemake:       makemake.o $(OBJFILES)
        $(CXX) $(CXXFLAGS) -o makemake makemake.o $(OBJFILES) $(CCLIBFLAGS)

#
# Dependencies
#

MakefileObject.o: MakefileObject.cpp MakefileObject.h
dirlist.o: dirlist.cpp dirlist.h
makemake.o: makemake.cpp dirlist.h write.h PlatformSwitcher.h
write.o: write.cpp write.h dirlist.h PlatformSwitcher.h

#
# Installation Targets
#

install: makemake 
        /usr/bin/install makemake /usr/bin

#
# Housekeeping
#

Archive:        archive.tgz

archive.tgz:    $(SOURCEFILES) Makefile
        tar cf - $(SOURCEFILES) Makefile | gzip > archive.tgz

clean:
        -/bin/rm $(OBJFILES) makemake.o core 2> /dev/null

realclean:        clean
        -/bin/rm -rf makemake