mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-04-04 13:33:08 +00:00
Simplify Linux build configurations.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
c05a236f1d
commit
df1f47fb36
21
compile.mk
21
compile.mk
@ -6,3 +6,24 @@ CXXFLAGS_COVERAGE = $(CXXFLAGS_DEBUG) -fprofile-arcs -ftest-coverage
|
||||
|
||||
CXXFLAGS_PROFILE = $(CXXFLAGS_OPT) -fprofile-generate
|
||||
CXXFLAGS_PROFILED = $(CXXFLAGS_OPT) -fprofile-use
|
||||
|
||||
CXXOBJECTS = $(CXXFILES:.cpp=.o)
|
||||
|
||||
SOURCES = $(CXXFILES)
|
||||
OBJECTS = $(CXXOBJECTS)
|
||||
|
||||
PCH = stdafx.h.gch
|
||||
|
||||
all: opt
|
||||
|
||||
opt: CXXFLAGS += $(CXXFLAGS_OPT)
|
||||
debug: CXXFLAGS += $(CXXFLAGS_DEBUG)
|
||||
coverage: CXXFLAGS += $(CXXFLAGS_COVERAGE)
|
||||
profile: CXXFLAGS += $(CXXFLAGS_PROFILE)
|
||||
profiled: CXXFLAGS += $(CXXFLAGS_PROFILED)
|
||||
|
||||
$(PCH): stdafx.h
|
||||
$(CXX) $(CXXFLAGS) -x c++-header $<
|
||||
|
||||
%.o: %.cpp $(PCH)
|
||||
$(CXX) $(CXXFLAGS) $< -c -o $@
|
||||
|
24
exe_build.mk
24
exe_build.mk
@ -1,40 +1,16 @@
|
||||
CXXOBJECTS = $(CXXFILES:.cpp=.o)
|
||||
|
||||
LDFLAGS += -g
|
||||
|
||||
SOURCES = $(CXXFILES)
|
||||
OBJECTS = $(CXXOBJECTS)
|
||||
|
||||
PCH = stdafx.h.gch
|
||||
|
||||
all: opt
|
||||
|
||||
opt: CXXFLAGS += $(CXXFLAGS_OPT)
|
||||
opt: $(EXE)
|
||||
|
||||
debug: CXXFLAGS += $(CXXFLAGS_DEBUG)
|
||||
debug: $(EXE)
|
||||
|
||||
coverage: CXXFLAGS += $(CXXFLAGS_COVERAGE)
|
||||
coverage: LDFLAGS += -lgcov
|
||||
coverage: $(EXE)
|
||||
|
||||
profile: CXXFLAGS += $(CXXFLAGS_PROFILE)
|
||||
profile: LDFLAGS += -lgcov
|
||||
profile: $(EXE)
|
||||
|
||||
profiled: CXXFLAGS += $(CXXFLAGS_PROFILED)
|
||||
profiled: $(EXE)
|
||||
|
||||
$(PCH): stdafx.h
|
||||
$(CXX) $(CXXFLAGS) -x c++-header $<
|
||||
|
||||
$(EXE): $(OBJECTS)
|
||||
$(CXX) $(OBJECTS) -o $(EXE) $(LDFLAGS)
|
||||
|
||||
%.o: %.cpp $(PCH)
|
||||
$(CXX) $(CXXFLAGS) $< -c -o $@
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-rm -f $(EXE) $(OBJECTS) $(PCH) *.gcov *.gcda *.gcno
|
||||
|
24
lib_build.mk
24
lib_build.mk
@ -1,36 +1,12 @@
|
||||
CXXOBJECTS = $(CXXFILES:.cpp=.o)
|
||||
|
||||
SOURCES = $(CXXFILES)
|
||||
OBJECTS = $(CXXOBJECTS)
|
||||
|
||||
PCH = stdafx.h.gch
|
||||
|
||||
all: opt
|
||||
|
||||
opt: CXXFLAGS += $(CXXFLAGS_OPT)
|
||||
opt: $(LIB)
|
||||
|
||||
debug: CXXFLAGS += $(CXXFLAGS_DEBUG)
|
||||
debug: $(LIB)
|
||||
|
||||
coverage: CXXFLAGS += $(CXXFLAGS_COVERAGE)
|
||||
coverage: $(LIB)
|
||||
|
||||
profile: CXXFLAGS += $(CXXFLAGS_PROFILE)
|
||||
profile: $(LIB)
|
||||
|
||||
profiled: CXXFLAGS += $(CXXFLAGS_PROFILED)
|
||||
profiled: $(LIB)
|
||||
|
||||
$(PCH): stdafx.h
|
||||
$(CXX) $(CXXFLAGS) -x c++-header $<
|
||||
|
||||
$(LIB): $(OBJECTS)
|
||||
$(AR) $(ARFLAGS) $(LIB) $(OBJECTS)
|
||||
|
||||
%.o: %.cpp $(PCH)
|
||||
$(CXX) $(CXXFLAGS) $< -c -o $@
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-rm -f $(LIB) $(OBJECTS) $(PCH)
|
||||
|
Loading…
x
Reference in New Issue
Block a user