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
|
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,23 +1,35 @@
# if compiling for SunOS, you need to add -lsocket to the LIBS variable
SH = /bin/sh
-CC = gcc
+CC = g++
MAKEFILE= Makefile
-CFLAGS = -O2 --pipe
+CFLAGS = -O2 -pipe -Wall -Wshadow
LIBS =
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -g
+endif
+
+ifeq ($(shell uname),Linux)
+ CFLAGS += -DHAVE_SENDFILE
+endif
+
OBJECTS = main.o socket.o httpsock.o
.cc.o:
$(CC) $(CFLAGS) -c -o $*.o $<
-all: compile dhttpd
+all: dhttpd
-compile: $(OBJECTS)
+compile: dhttpd
dhttpd: $(OBJECTS)
$(CC) -o dhttpd $(OBJECTS) $(LIBS)
- strip dhttpd
+
+install: dhttpd
+ install dhttpd $(DESTDIR)/usr/bin
clean:
- rm dhttpd $(OBJECTS)
+ rm -f dhttpd $(OBJECTS)
+
+distclean: clean
|