forked from junghans/engineeringdojo-dockeruser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (22 loc) · 694 Bytes
/
Makefile
File metadata and controls
32 lines (22 loc) · 694 Bytes
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
#change the name of the program here
NAME=main
#add extra cc file to compile here
EXTRA_SRC=
all: $(NAME)
LIBS=`pkg-config --libs libmym`
CFLAGS+=`pkg-config --cflags libmym`
#generate a list of object (.o) files
OBJS=$(patsubst %.c,%.o,$(NAME).c $(EXTRA_SRC))
#main program depend on all objects, rest is done by implicit rules
$(NAME): $(OBJS) .LDFLAGS
${CC} ${LDFLAGS} -o ${NAME} ${OBJS} ${LIBS}
#clean up rule
clean:
rm -f $(NAME) $(OBJS) .CFLAGS .LDFLAGS
dummy: ;
.%FLAGS: dummy
@[ -f $@ ] || touch $@
@echo "$*FLAGS=$($*FLAGS)" | cmp -s $@ - || echo "$*FLAGS=$($*FLAGS)" > $@
$(OBJS): .CFLAGS
#all, clean are phony rules, e.g. they should always run
.PHONY: all clean dummy