# Makefile for SRG CXXFLAGS=-fno-common -Iinclude/ -Wall CFLAGS=-fno-common -Wall SRG_INCLUDES=include/srg.h include/prototypes.h LDFLAGS+=-Llib/ PREFIX ?= /usr/local all: test srg test: parser-test resolver-test @echo Executing tests... ./parser-test ./resolver-test srg: UserReport.o SiteReport.o LocationReport.o Report.o getdate.o md5.o main.cc include/getline.hh include/resolver.hh parseURL.o configuration.o utils.o ip2user.o cd lib && $(MAKE) || exit 1 $(CXX) $(CXXFLAGS) $(LDFLAGS) main.cc -o srg getdate.o md5.o UserReport.o SiteReport.o LocationReport.o Report.o parseURL.o configuration.o utils.o ip2user.o -lconfig -lfl UserReport.o: UserReport.cc include/UserReport.h SiteReport.cc include/SiteReport.h LocationReport.cc include/LocationReport.h $(SRG_INCLUDES) $(CXX) $(CXXFLAGS) -c UserReport.cc -o UserReport.o SiteReport.o: SiteReport.cc include/SiteReport.h LocationReport.cc include/LocationReport.h $(SRG_INCLUDES) $(CXX) $(CXXFLAGS) -c SiteReport.cc -o SiteReport.o LocationReport.o: LocationReport.cc include/LocationReport.h $(SRG_INCLUDES) $(CXX) $(CXXFLAGS) -c LocationReport.cc -o LocationReport.o Report.o: Report.cc include/Report.h $(SRG_INCLUDES) $(CXX) $(CXXFLAGS) -c Report.cc -o Report.o getdate.o: getdate.c $(CC) $(CFLAGS) -w -DSTDC_HEADERS -c getdate.c -o getdate.o md5.o: md5.c $(CC) $(CFLAGS) -c md5.c -o md5.o parseURL.o: include/srg.h parseURL.cc $(CXX) $(CXXFLAGS) -c parseURL.cc -o parseURL.o configuration.o: include/srg.h configuration.cc $(CXX) $(CXXFLAGS) -c configuration.cc -o configuration.o utils.o: include/srg.h utils.cc $(CXX) $(CXXFLAGS) -c utils.cc -o utils.o *.h: echo 1 clean: @(rm -rf *.o srg *-test) cd lib && $(MAKE) clean || exit 1 parser-test: parseURL.cc include/srg.h include/prototypes.h $(CXX) $(CXXFLAGS) $(LDFLAGS) -DTEST parseURL.cc -o parser-test resolver-test: resolver-test.cpp include/resolver.hh $(CXX) $(CXXFLAGS) $(LDFLAGS) resolver-test.cpp -o resolver-test install: install -D --group=root --mode=555 --owner=root \ srg $(DESTDIR)$(PREFIX)/sbin/srg .PHONY: all clean install