Skip to content

Commit 5dbe5ee

Browse files
committed
1.0: simplify Makefile and clean repo
1 parent 7dfad88 commit 5dbe5ee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+4528
-4094
lines changed

Makefile

+110-111
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,110 @@
1-
.phony: common
2-
.phony: encodetool
3-
.phony: decodetool
4-
.phony: clean
5-
6-
#----------------------------#
7-
# Directories
8-
#----------------------------#
9-
10-
OBJDIR := build
11-
RELDIR := release
12-
13-
INCDIR := include
14-
COMMON_SRCDIR := fourier libulc
15-
ENCODETOOL_SRCDIR := tools
16-
DECODETOOL_SRCDIR := tools
17-
18-
#----------------------------#
19-
# Cross-compilation, compile flags
20-
#----------------------------#
21-
22-
# Alternatively, try "-march=native" for ARCHFLAGS
23-
ARCHCROSS :=
24-
ARCHFLAGS := -msse -msse2 -mavx -mavx2 -mfma
25-
26-
CCFLAGS := $(ARCHFLAGS) -fno-math-errno -ffast-math -O2 -Wall -Wextra $(foreach dir, $(INCDIR), -I$(dir))
27-
LDFLAGS := -static -s
28-
29-
#----------------------------#
30-
# Tools
31-
#----------------------------#
32-
33-
CC := $(ARCHCROSS)gcc
34-
LD := $(ARCHCROSS)gcc
35-
36-
#----------------------------#
37-
# Files
38-
#----------------------------#
39-
40-
COMMON_SRC := $(foreach dir, $(COMMON_SRCDIR), $(wildcard $(dir)/*.c))
41-
ENCODETOOL_SRC := $(filter-out $(ENCODETOOL_SRCDIR)/ulcDecodeTool.c, $(wildcard $(ENCODETOOL_SRCDIR)/*.c))
42-
DECODETOOL_SRC := $(filter-out $(DECODETOOL_SRCDIR)/ulcEncodeTool.c, $(wildcard $(DECODETOOL_SRCDIR)/*.c))
43-
COMMON_OBJ := $(addprefix $(OBJDIR)/, $(notdir $(COMMON_SRC:.c=.o)))
44-
ENCODETOOL_OBJ := $(addprefix $(OBJDIR)/, $(notdir $(ENCODETOOL_SRC:.c=.o)))
45-
DECODETOOL_OBJ := $(addprefix $(OBJDIR)/, $(notdir $(DECODETOOL_SRC:.c=.o)))
46-
ENCODETOOL_EXE := ulcencodetool
47-
DECODETOOL_EXE := ulcdecodetool
48-
49-
DFILES := $(wildcard $(OBJDIR)/*.d)
50-
51-
VPATH := $(COMMON_SRCDIR) $(ENCODETOOL_SRCDIR) $(DECODETOOL_SRCDIR)
52-
53-
#----------------------------#
54-
# General rules
55-
#----------------------------#
56-
57-
$(OBJDIR)/%.o : %.c
58-
@echo $(notdir $<)
59-
@$(CC) $(CCFLAGS) -c -o $@ $< -MMD -MP -MF $(OBJDIR)/$*.d
60-
61-
#----------------------------#
62-
# make all
63-
#----------------------------#
64-
65-
all : common encodetool decodetool
66-
67-
$(OBJDIR) $(RELDIR) :; mkdir -p $@
68-
69-
#----------------------------#
70-
# make common
71-
#----------------------------#
72-
73-
common : $(COMMON_OBJ)
74-
75-
$(COMMON_OBJ) : $(COMMON_SRC) | $(OBJDIR)
76-
77-
#----------------------------#
78-
# make encodetool
79-
#----------------------------#
80-
81-
encodetool : $(ENCODETOOL_EXE)
82-
83-
$(ENCODETOOL_OBJ) : $(ENCODETOOL_SRC) | $(OBJDIR)
84-
85-
$(ENCODETOOL_EXE) : $(COMMON_OBJ) $(ENCODETOOL_OBJ) | $(RELDIR)
86-
$(LD) -o $(RELDIR)/$@ $^ $(LDFLAGS)
87-
88-
#----------------------------#
89-
# make decodetool
90-
#----------------------------#
91-
92-
decodetool : $(DECODETOOL_EXE)
93-
94-
$(DECODETOOL_OBJ) : $(DECODETOOL_SRC) | $(OBJDIR)
95-
96-
$(DECODETOOL_EXE) : $(COMMON_OBJ) $(DECODETOOL_OBJ) | $(RELDIR)
97-
$(LD) -o $(RELDIR)/$@ $^ $(LDFLAGS)
98-
99-
#----------------------------#
100-
# make clean
101-
#----------------------------#
102-
103-
clean :; rm -rf $(OBJDIR) $(RELDIR)
104-
105-
#----------------------------#
106-
# Dependencies
107-
#----------------------------#
108-
109-
include $(wildcard $(DFILES))
110-
111-
#----------------------------#
1+
.phony: common
2+
.phony: encodetool
3+
.phony: decodetool
4+
.phony: clean
5+
6+
#----------------------------#
7+
# Directories
8+
#----------------------------#
9+
10+
OBJDIR := build
11+
12+
INCDIR := include
13+
COMMON_SRCDIR := fourier libulc
14+
ENCODETOOL_SRCDIR := tools
15+
DECODETOOL_SRCDIR := tools
16+
17+
#----------------------------#
18+
# Cross-compilation, compile flags
19+
#----------------------------#
20+
21+
# Alternatively, try "-march=native" for ARCHFLAGS
22+
ARCHCROSS :=
23+
ARCHFLAGS := -msse -msse2 -mavx -mavx2 -mfma
24+
25+
CCFLAGS := $(ARCHFLAGS) -fno-math-errno -ffast-math -O2 -Wall -Wextra $(foreach dir, $(INCDIR), -I$(dir))
26+
LDFLAGS := -static -s -lm
27+
28+
#----------------------------#
29+
# Tools
30+
#----------------------------#
31+
32+
CC := $(ARCHCROSS)gcc
33+
LD := $(ARCHCROSS)gcc
34+
35+
#----------------------------#
36+
# Files
37+
#----------------------------#
38+
39+
COMMON_SRC := $(foreach dir, $(COMMON_SRCDIR), $(wildcard $(dir)/*.c))
40+
ENCODETOOL_SRC := $(filter-out $(ENCODETOOL_SRCDIR)/ulcdecodetool.c, $(wildcard $(ENCODETOOL_SRCDIR)/*.c))
41+
DECODETOOL_SRC := $(filter-out $(DECODETOOL_SRCDIR)/ulcencodetool.c, $(wildcard $(DECODETOOL_SRCDIR)/*.c))
42+
COMMON_OBJ := $(addprefix $(OBJDIR)/, $(notdir $(COMMON_SRC:.c=.o)))
43+
ENCODETOOL_OBJ := $(addprefix $(OBJDIR)/, $(notdir $(ENCODETOOL_SRC:.c=.o)))
44+
DECODETOOL_OBJ := $(addprefix $(OBJDIR)/, $(notdir $(DECODETOOL_SRC:.c=.o)))
45+
ENCODETOOL_EXE := ulcencodetool
46+
DECODETOOL_EXE := ulcdecodetool
47+
48+
DFILES := $(wildcard $(OBJDIR)/*.d)
49+
50+
VPATH := $(COMMON_SRCDIR) $(ENCODETOOL_SRCDIR) $(DECODETOOL_SRCDIR)
51+
52+
#----------------------------#
53+
# General rules
54+
#----------------------------#
55+
56+
$(OBJDIR)/%.o : %.c
57+
@echo $(notdir $<)
58+
@$(CC) $(CCFLAGS) -c -o $@ $< -MMD -MP -MF $(OBJDIR)/$*.d
59+
60+
#----------------------------#
61+
# make all
62+
#----------------------------#
63+
64+
all : common encodetool decodetool
65+
66+
$(OBJDIR) :; mkdir -p $@
67+
68+
#----------------------------#
69+
# make common
70+
#----------------------------#
71+
72+
common : $(COMMON_OBJ)
73+
74+
$(COMMON_OBJ) : $(COMMON_SRC) | $(OBJDIR)
75+
76+
#----------------------------#
77+
# make encodetool
78+
#----------------------------#
79+
80+
encodetool : $(ENCODETOOL_EXE)
81+
82+
$(ENCODETOOL_OBJ) : $(ENCODETOOL_SRC) | $(OBJDIR)
83+
84+
$(ENCODETOOL_EXE) : $(COMMON_OBJ) $(ENCODETOOL_OBJ)
85+
$(LD) $^ $(LDFLAGS) -o $@
86+
87+
#----------------------------#
88+
# make decodetool
89+
#----------------------------#
90+
91+
decodetool : $(DECODETOOL_EXE)
92+
93+
$(DECODETOOL_OBJ) : $(DECODETOOL_SRC) | $(OBJDIR)
94+
95+
$(DECODETOOL_EXE) : $(COMMON_OBJ) $(DECODETOOL_OBJ)
96+
$(LD) $^ $(LDFLAGS) -o $@
97+
98+
#----------------------------#
99+
# make clean
100+
#----------------------------#
101+
102+
clean :; rm -rf $(OBJDIR) $(ENCODETOOL_EXE) $(DECODETOOL_EXE)
103+
104+
#----------------------------#
105+
# Dependencies
106+
#----------------------------#
107+
108+
include $(wildcard $(DFILES))
109+
110+
#----------------------------#

fourier/Fourier_DCT2.c

-138
This file was deleted.

0 commit comments

Comments
 (0)