-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (26 loc) · 795 Bytes
/
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
CFLAGS = -O3 -ffast-math -fno-omit-frame-pointer -Wall
LIBS =
BUILD = build
OBJFILES = \
ggxcc.o
ggxcc.exe: $(OBJFILES:%.o=$(BUILD)/%.o)
$(CC) $(OBJFILES:%.o=$(BUILD)/%.o) $(LIBS) -o $@
default: ggxcc.exe
clean:
rm -rf $(BUILD)/*
rm -rf ggxcc.exe
$(BUILD):
mkdir $(BUILD)
$(BUILD)/%.o: %.c | $(BUILD)
$(CC) $(CFLAGS) -MD -c $< -o $@
@cp $(BUILD)/$*.d $(BUILD)/$*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(BUILD)/$*.d >> $(BUILD)/$*.P; \
rm -f $(BUILD)/$*.d
$(BUILD)/%.o: %.cpp | $(BUILD)
$(CXX) $(CFLAGS) -MD -c $< -o $@
@cp $(BUILD)/$*.d $(BUILD)/$*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(BUILD)/$*.d >> $(BUILD)/$*.P; \
rm -f $(BUILD)/$*.d
-include $(BUILD)/*.P