# # logresolve 2.0 - http://www.net/~tomr/progs/logresolve/ # # Tom Rathborne - tomr@uunet.ca - http://www.net/~tomr/ # # # Please use GNU Make! I've had trouble with others. # ###### Available commands: # 'make' compiles everything (currently just logresolve) # 'make logresolve' builds the program (same as just 'make' right now) # # 'make sweep' cleans up (removes pieces) # 'make clean' cleans up (removes objects AND executables) # # 'make distdir' puts distribution files into a 'dist' directory # 'make indent' runs my preferred indent command on all files ###### Compiler and flags # I prefer gcc, that's why it's the default. COMPILER = gcc # For best speed/compactness, use: # (The -s gives about the same results as stripping your executable) CFLAGS = -O2 -s # Use this for Solaris, or wherever UCB stuff is needed: (from Bob Ramstad) # CFLAGS = -O2 -s -L/usr/ucblib -I/usr/ucbinclude # To really clean up the code, I use: # CFLAGS = -O3 -Wall -pedantic ###### Required libraries - varies by OS # Pick your favourite ndbm-compatible library: (choose at most one :) ) DBMLIB = -lgdbm # DBMLIB = -lndbm # DBMLIB = -ldb # DBMLIB = -ldbm # Solaris apparently needs socket, nameservice, and UCB libraries. # "Note that this also may require /usr/ucblib to be in LD_LIBRARY_PATH # in order for the executable to run properly." - Bob Ramstad # LIBS = -lsocket -lnsl -lucb # Linux, Irix and SunOS don't seem to need much else. ###### You shouldn't have to fiddle with anything below here! ###### TARGETS = logresolve SOURCES = logresolve.c lr-nsrec.c lr-stats.c lr-ip.c lr-hash.c lr-dbm.c OBJECTS = $(SOURCES:.c=.o) DOCS = logresolve.txt ### Note that everything is said to depend on the Makefile so that changes # in the Makefile are guaranteed to cause a full rebuild, just to be safe. ALLDEPS = logresolve.h Makefile INCLUDES = logresolve.h lr-dbm.h lr-hash.h lr-ip.h lr-nsrec.h lr-stats.h .SUFFIXES: .c .o .c.o: $(COMPILER) $(CFLAGS) -c $< logresolve: $(OBJECTS) $(COMPILER) $(CFLAGS) $(LIBS) $(DBMLIB) -o logresolve $(OBJECTS) $(OBJECTS) : $(ALLDEPS) $(COMPILER) $(CFLAGS) -c $*.c sweep: rm -f $(OBJECTS) clean: rm -f $(TARGETS) $(OBJECTS) distdir: rm -rf dist mkdir dist cp Makefile $(DOCS) $(SOURCES) $(INCLUDES) dist indent: indent -fc1 -bad -bap -sob -ncdb -sc -br -ce -cli4 -nss -npcs -cs -lp -ci4 -ip4 -i4 -l79 $(SOURCES) $(INCLUDES) rm $(SOURCES:=~) rm $(INCLUDES:=~) ### additional dependencies - anyone know a cleaner way to do this? logresolve.o: logresolve.c logresolve.h lr-nsrec.o: lr-nsrec.c lr-nsrec.h lr-stats.o: lr-stats.c lr-stats.h lr-ip.o: lr-ip.c lr-ip.h lr-nsrec.h lr-hash.o: lr-hash.c lr-hash.h lr-dbm.h lr-nsrec.h lr-dbm.o: lr-dbm.c lr-dbm.h lr-nsrec.h