forked from QMonkey/OOC-Design-Pattern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (28 loc) · 1.05 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
EXECPATH = ../bin
OBJPATH = ../obj/Iterator
INCLUDEPATH = include
LIBPATH = ../lib/include
SRCPATH = src
CC = gcc
OPTIONS = -Wall -fms-extensions
EXEC = $(EXECPATH)/Iterator
OBJS = $(OBJPATH)/arraylist.o $(OBJPATH)/linkedlist.o $(OBJPATH)/arraylist_iterator.o $(OBJPATH)/linkedlist_iterator.o $(OBJPATH)/main.o
all: dir build
dir:
mkdir -p $(OBJPATH)
mkdir -p $(EXECPATH)
build: $(OBJS) $(EXEC)
$(EXEC): $(OBJS)
$(CC) -g -o $@ $(OBJS)
$(OBJPATH)/arraylist.o: $(SRCPATH)/arraylist.c
$(CC) -g -c $< -I $(LIBPATH) -I $(INCLUDEPATH) -o $@ $(OPTIONS)
$(OBJPATH)/linkedlist.o: $(SRCPATH)/linkedlist.c
$(CC) -g -c $< -I $(LIBPATH) -I $(INCLUDEPATH) -o $@ $(OPTIONS)
$(OBJPATH)/arraylist_iterator.o: $(SRCPATH)/arraylist_iterator.c
$(CC) -g -c $< -I $(LIBPATH) -I $(INCLUDEPATH) -o $@ $(OPTIONS)
$(OBJPATH)/linkedlist_iterator.o: $(SRCPATH)/linkedlist_iterator.c
$(CC) -g -c $< -I $(LIBPATH) -I $(INCLUDEPATH) -o $@ $(OPTIONS)
$(OBJPATH)/main.o: $(SRCPATH)/main.c
$(CC) -g -c $< -I $(LIBPATH) -I $(INCLUDEPATH) -o $@ $(OPTIONS)
clean:
-rm -rf $(EXEC) $(OBJS)