Makefile 1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
BINDIR=bin
OBJDIR=obj
SRCDIR=src
INCDIR=include

CC = g++
CWARN = -W -Wall -Wshadow -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized -O

CDBG = -g $(CWARN) -fno-inline
CFLAGS = -I$(INCDIR) $(CDBG)
DFLAGS = -I$(INCDIR) -g $(CWARN) -fno-inline -DDEBUG=1

CTAG = ctags
CTAGFILE = filelist
# src, object and bin files
MAIN := netstream-main 

HEADERS = $(INCDIR)/global.h

OBJS = \
    $(OBJDIR)/tcpip/storage.o  \
	$(OBJDIR)/tcpip/socket.o \
    $(OBJDIR)/netstream-sender.o \
	$(OBJDIR)/netstream-main.o 
	 
.SECONDARY:

#-- Rules
all : $(MAIN)

$(MAIN) : $(OBJS)
	$(CC) $(CFLAGS) $(OBJS)  -o $(MAIN)
	
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
	$(CC) $(CFLAGS) -c $? -o $@ 

.PHONY : clean depend fresh

tag :
	find src/*.cpp include/*.h > filelist
	$(CTAG) -L $(CTAGFILE)

clean :
	-rm -f $(OBJDIR)/*.o $(PARSE_C) $(PARSE_H)
	-rm -f $(OBJDIR)/*/*.o $(PARSE_C) $(PARSE_H)
	-rm -f $(SRCDIR)/*.output $(LEX_C)
	-rm -f */*~ *~ core
	-rm -f $(BINDIR)/*
	-rm -f $(MAIN)

fresh : clean all