forked from Hydr8gon/Project-DS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.conv
More file actions
35 lines (27 loc) · 817 Bytes
/
Makefile.conv
File metadata and controls
35 lines (27 loc) · 817 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
33
34
35
NAME := converter
BUILD := build-conv
SRCS := src-conv libogg/src vorbis/lib
ARGS := -O2
INCS := -Ilibogg/include -Ivorbis/include -Ivorbis/lib
ifeq ($(OS),Windows_NT)
ARGS += -static -DWINDOWS
endif
CFILES := $(foreach dir,$(SRCS),$(wildcard $(dir)/*.c))
CPPFILES := $(foreach dir,$(SRCS),$(wildcard $(dir)/*.cpp))
HFILES := $(foreach dir,$(SRCS),$(wildcard $(dir)/*.h))
OFILES := $(patsubst %.c,$(BUILD)/%.o,$(CFILES)) $(patsubst %.cpp,$(BUILD)/%.o,$(CPPFILES))
all: $(NAME)
$(NAME): $(OFILES)
g++ -o $@ $(ARGS) $^
$(BUILD)/%.o: %.c $(HFILES) $(BUILD)
gcc -c -o $@ $(ARGS) $(INCS) $<
$(BUILD)/%.o: %.cpp $(HFILES) $(BUILD)
g++ -c -o $@ $(ARGS) $(INCS) $<
$(BUILD):
for dir in $(SRCS); \
do \
mkdir -p $(BUILD)/$$dir; \
done
clean:
rm -rf $(BUILD)
rm -f $(NAME)