-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (28 loc) · 807 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
#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
CLIBS = -pthread
#List all the .o files here that need to be linked
OBJS=CSftp.o usage.o dir.o commands.o
usage.o: usage.c usage.h
dir.o: dir.c dir.h
commands.o: commands.c commands.h
CSftp.o: CSftp.c dir.h usage.h
CSftp: $(OBJS)
$(CC) -o CSftp $(OBJS) $(CLIBS)
clean:
rm -f *.o
rm -f CSftp
.PHONY: run
run: CSftp
./CSftp $(RUN_ARGS)