all: nethogs

objects = structs.o packet.o connection.o process.o hashtbl.o refresh.o
compiler = g++ 
flags = -g
libs = -lpcap -lncurses 
#-lefence

nethogs: $(shell cat implications/nethogs.cpp) $(objects)
	$(compiler) $(flags) nethogs.cpp -o nethogs $(objects) $(libs)

# do not autogenerate.
%.o : %.cpp

structs.o : $(shell cat implications/structs.cpp)
	$(compiler) $(flags) -c $<
packet.o : $(shell cat implications/packet.cpp)
	$(compiler) $(flags) -c $<
connection.o : $(shell cat implications/connection.cpp)
	$(compiler) $(flags) -c $<
hashtbl.o : $(shell cat implications/hashtbl.cpp)
	$(compiler) $(flags) -c $<
process.o : $(shell cat implications/process.cpp)
	$(compiler) $(flags) -c $<
refresh.o : $(shell cat implications/refresh.cpp)
	$(compiler) $(flags) -c $<
