2000-12-10 04:09:52 +00:00
|
|
|
#
|
|
|
|
# GNU makefile fragment for building an executable
|
|
|
|
#
|
|
|
|
|
|
|
|
CC = gcc
|
|
|
|
# LINKAGE can be forced to -static or -dynamic from invocation if desired, but it defaults to -static
|
|
|
|
LINKAGE = -static
|
|
|
|
LINK = gcc $(LINKAGE)
|
|
|
|
BINPATH = ../../obj/bin
|
|
|
|
LIBPATH = ../../obj/lib
|
|
|
|
PROGRAM = $(BINPATH)/$(PROGRAM_NAME)
|
|
|
|
|
|
|
|
all : release
|
|
|
|
|
|
|
|
debug : CFLAGS = -g -O0 -DDEBUG $(DEBUG_CFLAGS) -Wall -W $(INCLUDES)
|
2001-02-05 23:19:09 +00:00
|
|
|
release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -ffast-math -finline-functions -DNDEBUG $(RELEASE_CFLAGS) -Wall -W $(INCLUDES)
|
2000-12-10 04:09:52 +00:00
|
|
|
|
|
|
|
LFLAGS = -L$(LIBPATH)
|
|
|
|
|
|
|
|
debug : $(PROGRAM)
|
|
|
|
release : $(PROGRAM)
|
|
|
|
|
|
|
|
$(PROGRAM) : $(OBJS)
|
|
|
|
$(LINK) -o $@ $(OBJS) $(LFLAGS) $(LIBS)
|
|
|
|
|
|
|
|
%.o : %.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
%.i : %.c
|
|
|
|
$(CC) $(CFLAGS) -E $< -o $@
|
|
|
|
|
|
|
|
.PHONY : clean
|
|
|
|
clean :
|
|
|
|
-rm -f $(OBJS) $(PROGRAM)
|
|
|
|
|
|
|
|
.PHONY : depend
|
|
|
|
depend:
|
|
|
|
makedepend -- $(CFLAGS) $(INCLUDES) -- *.c
|