# default build type TYPE = release # default OS OS = linux # defs for production-quality binaries ifeq ($(TYPE),release) CFLAGS = -O -Wall -Werror LDFLAGS = -s $(EXTRALIBS) endif # defs for test/debug binaries ifeq ($(TYPE),debug) CFLAGS =-Wall -Werror -DTRACE -g LDFLAGS = $(EXTRALIBS) endif # OS peculiarities ifeq ($(OS),solaris) EXTRALIBS = -lsocket -lnsl -lresolv endif ifeq ($(OS),linux) EXTRALIBS = endif ifeq ($(OS),cygwin) EXTRALIBS = endif # general def's CC = gcc DEPEND=$(CC) -MM LIBS = SOURCES = server.c helper.c PROGS := $(SOURCES:.c=) # phony targets .PHONY: all clean veryclean depend # general rule (make without any parameter) all: $(PROGS) # specific program generation rules server: server.o $(LIBS) # library # misc clean: /bin/rm -f *.o veryclean: /bin/rm -f *.o *.a $(PROGS) *.exe *~ depend: $(SOURCES) $(DEPEND) $(SOURCES)