summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile94
1 files changed, 63 insertions, 31 deletions
diff --git a/Makefile b/Makefile
index d3f6036..0113801 100644
--- a/Makefile
+++ b/Makefile
@@ -1,43 +1,75 @@
-all: httpup
+name=httpup
+version=0.4.0i
-############################################################################
-###
-## Configuration
-#
-NAME=httpup
-VERSION="0.4.0h"
-CXX=g++
-CXXFLAGS=-Wall -ansi -pedantic -DMF_VERSION='${VERSION}'
-LDFLAGS=-lcurl
+prefix= /usr/local
+bindir= $(prefix)/bin
+libdir= $(prefix)/lib
+includedir= $(prefix)/include
+mandir= $(prefix)/man
-objects=httpupargparser.o argparser.o main.o httpup.o \
- fileutils.o md5.o configparser.o
-httpupargparser.o: httpupargparser.cpp httpupargparser.h
-argparser.o: argparser.cpp argparser.h
-main.o: main.cpp
-httpup.o: httpup.cpp httpup.h
-fileutils.o: fileutils.cpp fileutils.h
-md5.o: md5.cpp md5.h
-configparser.o: configparser.cpp configparser.h
+CXX= g++
+CXXFLAGS= -O2 -pipe -DMF_VERSION=\"${version}\"
+CXXFLAGS+= -g -Wall -Werror
+LDFLAGS= -lcurl
+INSTALL= /usr/bin/install
+STRIP= /usr/bin/strip
-############################################################################
-$(objects): %.o: %.cpp
- $(CXX) -c $(CXXFLAGS) $< -o $@
+OBJS= httpup.o \
+ fileutils.o \
+ argparser.o \
+ md5.o \
+ httpupargparser.o \
+ configparser.o \
+ main.o
+# # Portability stuff.
+CXXFLAGS+= -Wno-strict-aliasing
+# OBJS+= strtonum.o strlcpy.o strlcat.o fgetln.o
-httpup: $(objects) *.cpp *.h
- g++ -o httpup $(objects) $(LDFLAGS)
+.c.o:
+ $(CC) $(CFLAGS) -c $<
+
+all: $(name)
+
+
+$(name): $(OBJS)
+ $(CXX) $(LDFLAGS) $(OBJS) -o $(name)
+
+distclean: clean
+ -rm -f Makefile config.log config.h *~ *.core core.*
clean:
- rm -f httpup $(objects)
+ -rm -f *.o $(name)
+
+
+install: $(name) $(name).8
+ $(INSTALL) -d $(DESTDIR)$(bindir)
+ $(INSTALL) -d $(DESTDIR)$(mandir)/man8
+ $(INSTALL) -m 755 $(name) $(DESTDIR)$(bindir)/$(name)
+ $(INSTALL) -m 755 httpup-repgen $(DESTDIR)$(bindir)/httpup-repgen
+ $(INSTALL) -m 644 $(name).8 $(DESTDIR)$(mandir)/man8/$(name).8
+ $(INSTALL) -m 644 httpup-repgen.8 \
+ $(DESTDIR)$(mandir)/man8/httpup-repgen.8
+
+install-strip: install
+ $(STRIP) $(DESTDIR)$(bindir)/$(name)
+
+uninstall:
+ rm -f \
+ $(DESTDIR)$(bindir)/$(name) \
+ $(DESTDIR)$(mandir)/man1/$(name).8
+
+rebuild:
+ make clean all
+
-dist:
- rm -rf ${NAME}-${VERSION}
- mkdir ${NAME}-${VERSION}
+dist: all
+ rm -rf $(name)-$(version)
+ mkdir $(name)-$(version)
cp *.cpp *.h Makefile AUTHORS COPYING ChangeLog README TODO *.8 \
- httpup-repgen* httpup.conf* ${NAME}-${VERSION}
- tar cvzf ${NAME}-${VERSION}.tar.gz ${NAME}-${VERSION}
- rm -rf ${NAME}-${VERSION}
+ httpup-repgen* httpup.conf* $(name)-$(version)
+ tar cvzf $(name)-$(version).tar.gz $(name)-$(version)
+ rm -rf $(name)-$(version)

Generated by cgit