-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (42 loc) · 1.31 KB
/
Makefile
File metadata and controls
54 lines (42 loc) · 1.31 KB
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
# Makefile for CPE464 library
#
# You should modify this makefile to meet your needs and to meet the
# requirements of the assignment. This makefile is only provided as
# an example. You can use it as much as you want but using this makefile
# is not required.
CC = g++
CFLAGS = -g -Wall -Werror
OS = $(shell uname -s)
ifeq ("$(OS)", "Linux")
LIBS1 = -lstdc++
endif
LIBS += -lstdc++
SRCS = $(shell ls *.c 2> /dev/null)
OBJS = $(shell ls *.c 2> /dev/null | sed s/\.c[p]*$$/\.o/ )
LIBNAME = $(shell ls *cpe464*.a)
ALL = rcopy server
#ALL = SREJ
all: $(OBJS) $(ALL)
lib:
make -f lib.mk
echo:
@echo "Objects: $(OBJS)"
@echo "LIBNAME: $(LIBNAME)"
rcopy: rcopy.c
@echo "-------------------------------"
@echo "*** Linking $@ with library $(LIBNAME)... "
$(CC) $(CFLAGS) -o $@ $^ srej.o networks.o window.o $(LIBNAME) $(LIBS)
@echo "*** Linking Complete!"
@echo "-------------------------------"
server: server.c
@echo "-------------------------------"
@echo "*** Linking $@ with library $(LIBNAME)... "
$(CC) $(CFLAGS) -o $@ $^ srej.o networks.o window.o $(LIBNAME) $(LIBS)
@echo "*** Linking Complete!"
@echo "-------------------------------"
# clean targets for Solaris and Linux
clean:
@echo "-------------------------------"
@echo "*** Cleaning Files..."
rm -f *.o $(ALL)
@echo "-------------------------------"