-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (29 loc) · 909 Bytes
/
Makefile
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
#This is a hack to pass arguments to the run command and probably only
#works with gnu make.
ifeq (run,$(firstword $(MAKECMDGOALS)))
# use the rest as arguments for "run"
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(RUN_ARGS):;@:)
endif
all: CSftp
#The following lines contain the generic build options
CC=gcc
CPPFLAGS=
CFLAGS=-g -Werror-implicit-function-declaration
#List all the .o files here that need to be linked
OBJS=CSftp.o usage.o dir.o controlServer.o dataServer.o command.o
usage.o: usage.c usage.h
dir.o: dir.c dir.h
CSftp.o: CSftp.c dir.h usage.h controlServer.h
controlServer.o: controlServer.c command.h
dataServer.o: dataServer.c dir.h
command.o: command.c dir.h dataServer.h
CSftp: $(OBJS)
$(CC) -o CSftp $(OBJS)
clean:
rm -f *.o
rm -f CSftp
.PHONY: run
run: CSftp
./CSftp $(RUN_ARGS)