Fix makefile
[xylftp.git] / server / src / Makefile
blobe4b6e807c41b9b0f5a435ae52dbe61136780ef29
1 # This is the makefile for server of xylftp.
2 # Copyright (C) WANG Cong, May 17, 2007.
3 # GPLv2 applies.
5 .PHONY: all clean debug
7 CC=gcc
8 CFLAGS= -Wall -W -Wcast-align -Wstrict-prototypes -Wshadow
9 LDFLAGS= -lssl
11 all: xylftp
13 xylftp: xylftp.o read_configure.o write_log.o xylsocket.o telnet.o parse_cmd.o do_cmd.o
14 $(CC) $(CFLAGS) $(LDFLAGS) -O2 -Os -o $@ $^
16 xylftp.o: xylftp.c
17 $(CC) $(CFLAGS) -O2 -c -o $@ $^
19 read_configure.o: read_configure.c
20 $(CC) $(CFLAGS) -O2 -c -o $@ $^
22 write_log.o: write_log.c
23 $(CC) $(CFLAGS) -O2 -c -o $@ $^
25 xylsocket.o: xylsocket.c
26 $(CC) $(CFLAGS) -O2 -c -o $@ $^
28 telnet.o: telnet.c
29 $(CC) $(CFLAGS) -O2 -c -o $@ $^
31 parse_cmd.o: parse_cmd.c
32 $(CC) $(CFLAGS) -O2 -c -o $@ $^
34 do_cmd.o: do_cmd.c
35 $(CC) $(CFLAGS) -O2 -c -o $@ $^
37 clean:
38 rm -f *.o xylftp xylftp.debug
40 debug: xylftp.debug
41 xylftp.debug: xylftp.h xylftp.c read_configure.c write_log.c xylsocket.c telnet.c parse_cmd.c do_cmd.h do_cmd.c debug.h
42 $(CC) $(CFLAGS) $(LDFLAGS) -DDEBUG -ggdb -o $@ $^
44 install: all
45 mkdir -p /etc/xylftp
46 touch /etc/xylftp/xylftp.pass
47 install -m 744 ../doc/xylftp.conf /etc/xylftp/
48 install -m 744 ./xylftp /usr/bin/
50 uninstall: clean
51 rm -rf /etc/xylftp/
52 rm -rf /usr/bin/xylftp