-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
68 lines (51 loc) · 1.97 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File: Makefile
# Author: Kerry Veenstra
#
# Purpose: This is the base Makefile
#
# You can edit this Makefile as necessary.
# This Makefile expects the following directory structure:
#
# ./Makefile This file.
# ./src/ Put your project's source files here.
# ./doc/ Put your project's documentation here.
# ./obj/ Object files are created here.
# ./obj/Makefile Don't edit this helper Makefile.
# ./bin/ Executables are created here.
# ./bin/Makefile Don't edit this helper Makefile.
#
# The bin and obj directories contain their own Makefiles.
# Usually these Makefiles do not need to be changed.
#
# The executable programs are written in the bin directory.
#
# References: Mecklenburg, Robert. Managing Projects with GNU Make.
# O'Reilly Media. 2004.
# ======================================
# Edit these variables for your project.
# ======================================
CLIENT_EXE = myrip
CLIENT_CFILES = myrip.c
COMMON_CFILES = myunp.c mytimer.c
# ================================================================
# Usually the lines in the rest of this file can remain unchanged.
# ================================================================
CLIENT_OBJS = $(subst .c,.o,$(CLIENT_CFILES))
SERVER_OBJS = $(subst .c,.o,$(SERVER_CFILES))
COMMON_OBJS = $(subst .c,.o,$(COMMON_CFILES))
CFILES = $(CLIENT_CFILES) $(SERVER_CFILES) $(COMMON_CFILES)
OBJS = $(CLIENT_OBJS) $(SERVER_OBJS) $(COMMON_OBJS)
export CLIENT_EXE SERVER_EXE
export CLIENT_CFILES SERVER_CFILES COMMON_CFILES CFILES
export CLIENT_OBJS SERVER_OBJS COMMON_OBJS OBJS
.PHONY: all
all : objs bins
.PHONY: objs
objs :
cd obj && $(MAKE)
.PHONY: bins
bins :
cd bin && $(MAKE)
.PHONY: clean
clean :
cd obj && $(MAKE) clean