From Electron Cloud
Revision as of 19:20, 22 December 2006 by Koogooshii (Talk | contribs)

Jump to: navigation, search

This is just a basic starting point for compiling a C project.

TARGET = theapp
SOURCES = $(wildcard *.c)
OBJECTS = $(subst .c$,.o,$(SOURCES))
HEADERS = $(wildcard *.h)
CC = gcc
LINK = gcc
STRIP = strip

$(TARGET): .depend $(OBJECTS)
        $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBPATH) $(LIBS)
        $(STRIP) $(TARGET)

.c.o: $*.h common.h
        $(CC) -c $(CFLAGS) $(DEBUGFLAGS) $(INCPATH) -o $@ $<

-include .depend

version.h:
        echo "#define BUILD_DATE \"`/bin/date \"+%d %b %Y\"`\"" > version.h

clean:
        -rm -f .depend
        -rm -f $(OBJECTS)
        -rm -f *~ core *.core
        -rm -f version.h
        -rm -f $(TARGET)

depend:
.depend: Makefile $(SOURCES) $(HEADERS)
        @if [ ! -f .depend ]; then touch .depend; fi
        @makedepend -Y -f .depend  $(SOURCES) 2>/dev/null

test:
        echo $(OBJECTS)


online casino gamble slots slots tips best casinos online Casino games. strategy online casino Casino games. online casino directory free casinos on line online casino