Changes in libs, passes and tests Makefiles. LDLIBS -> LIBS. LDFLAGS -> LINKFLAGS. CXX is clang++ or g++, not clang and gcc

This commit is contained in:
Roland Coeurjoly 2024-02-25 17:23:56 +01:00
parent dea4aeae56
commit 4a2fb18718
4 changed files with 9 additions and 11 deletions

View File

@ -1,9 +1,9 @@
CC = clang CC = clang
CXX = clang CXX = clang++
CXXFLAGS = -MD -Wall -Wextra -ggdb CXXFLAGS = -MD -Wall -Wextra -ggdb
CXXFLAGS += -std=c++11 -O0 CXXFLAGS += -std=c++11 -O0
LDLIBS = ../minisat/Options.cc ../minisat/SimpSolver.cc ../minisat/Solver.cc ../minisat/System.cc -lm -lstdc++ LIBS = ../minisat/Options.cc ../minisat/SimpSolver.cc ../minisat/Solver.cc ../minisat/System.cc -lm -lstdc++
all: demo_vec demo_bit demo_cmp testbench puzzle3d all: demo_vec demo_bit demo_cmp testbench puzzle3d
@ -27,4 +27,3 @@ clean:
.PHONY: all test clean .PHONY: all test clean
-include *.d -include *.d

View File

@ -5,9 +5,9 @@ CONFIG := clang-debug
# CONFIG := release # CONFIG := release
CC = clang CC = clang
CXX = clang CXX = clang++
CXXFLAGS = -MD -Wall -Wextra -ggdb CXXFLAGS = -MD -Wall -Wextra -ggdb
LDLIBS = -lstdc++ LIBS = -lstdc++
ifeq ($(CONFIG),clang-debug) ifeq ($(CONFIG),clang-debug)
CXXFLAGS += -std=c++11 -O0 CXXFLAGS += -std=c++11 -O0
@ -15,19 +15,19 @@ endif
ifeq ($(CONFIG),gcc-debug) ifeq ($(CONFIG),gcc-debug)
CC = gcc CC = gcc
CXX = gcc CXX = g++
CXXFLAGS += -std=gnu++0x -O0 CXXFLAGS += -std=gnu++0x -O0
endif endif
ifeq ($(CONFIG),profile) ifeq ($(CONFIG),profile)
CC = gcc CC = gcc
CXX = gcc CXX = g++
CXXFLAGS += -std=gnu++0x -Os -DNDEBUG CXXFLAGS += -std=gnu++0x -Os -DNDEBUG
endif endif
ifeq ($(CONFIG),release) ifeq ($(CONFIG),release)
CC = gcc CC = gcc
CXX = gcc CXX = g++
CXXFLAGS += -std=gnu++0x -march=native -O3 -DNDEBUG CXXFLAGS += -std=gnu++0x -march=native -O3 -DNDEBUG
endif endif
@ -50,4 +50,3 @@ clean:
.PHONY: all test clean .PHONY: all test clean
-include *.d -include *.d

View File

@ -56,5 +56,5 @@ EXTRA_OBJS += passes/techmap/filterlib.o
$(PROGRAM_PREFIX)yosys-filterlib$(EXE): passes/techmap/filterlib.o $(PROGRAM_PREFIX)yosys-filterlib$(EXE): passes/techmap/filterlib.o
$(Q) mkdir -p $(dir $@) $(Q) mkdir -p $(dir $@)
$(P) $(CXX) -o $(PROGRAM_PREFIX)yosys-filterlib$(EXE) $(LDFLAGS) $^ $(LDLIBS) $(P) $(CXX) -o $(PROGRAM_PREFIX)yosys-filterlib$(EXE) $(LINKFLAGS) $^ $(LIBS)
endif endif

View File

@ -15,7 +15,7 @@ TESTS := $(addprefix $(BINTEST)/, $(basename $(ALLTESTFILE:%Test.cc=%Test.o)))
all: prepare $(TESTS) run-tests all: prepare $(TESTS) run-tests
$(BINTEST)/%: $(OBJTEST)/%.o $(BINTEST)/%: $(OBJTEST)/%.o
$(CXX) -L$(ROOTPATH) $(RPATH)=$(ROOTPATH) -o $@ $^ $(LDLIBS) \ $(CXX) -L$(ROOTPATH) $(RPATH)=$(ROOTPATH) -o $@ $^ $(LIBS) \
$(GTESTFLAG) $(EXTRAFLAGS) $(GTESTFLAG) $(EXTRAFLAGS)
$(OBJTEST)/%.o: $(basename $(subst $(OBJTEST),.,%)).cc $(OBJTEST)/%.o: $(basename $(subst $(OBJTEST),.,%)).cc