PageRenderTime 102ms CodeModel.GetById 40ms app.highlight 4ms RepoModel.GetById 36ms app.codeStats 0ms

/Avc/Makefile

http://github.com/mbebenita/Broadway
Makefile | 55 lines | 37 code | 11 blank | 7 comment | 0 complexity | 8a4762accea56b113e715535679c918e MD5 | raw file
 1# Compiler 
 2# -DMB_BASED_DEBLOCK -DUSE_PRED_BLOCK
 3OPTS = -m32 -g -O3 -Wall -DOSCL_IMPORT_REF= -DOSCL_UNUSED_ARG= -DOSCL_EXPORT_REF=
 4ifeq ($(LINUX),1)
 5OPTS += -DLINUX
 6endif
 7
 8LDFLAGS = -m32 
 9# Project name
10PROJECT = avc
11
12# Directories
13OBJDIR = obj
14SRCDIR = .
15
16# Libraries
17ifeq ($(LINUX),1)
18LIBS = -lSDL
19else
20LIBS =  -framework Cocoa -framework SDL
21endif
22
23# Files and folders
24SRCS    = $(shell find $(SRCDIR) -name '*.cpp')
25OBJS    = $(patsubst $(SRCDIR)/%.cpp,$(OBJDIR)/%.o,$(SRCS))
26
27# Targets
28ifeq ($(LINUX),1)
29$(PROJECT): build-dirs $(OBJS)
30	$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
31
32$(OBJDIR)/SDLMain.o: SDLMain.m
33	$(CC) $(OPTS) -c $< -o $@
34else
35$(PROJECT): build-dirs $(OBJS) $(OBJDIR)/SDLMain.o
36	$(CC) $(LDFLAGS) $(OBJS) $(OBJDIR)/SDLMain.o $(LIBS) -o $@
37
38$(OBJDIR)/SDLMain.o: SDLMain.m
39	$(CC) $(OPTS) -c $< -o $@
40endif
41	
42$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
43	$(CC) $(OPTS) -c $< -o $@
44
45clean:
46	rm -Rf $(OBJDIR)
47	rm *.ll
48	rm *.bc
49
50build-dirs:
51	@$(call make-dirs)
52
53define make-dirs
54	mkdir -p $(OBJDIR)
55endef