Fixing build on Ubuntu (and variants)

When I tried to build on Xubuntu 18.04 I got multiple linking error whose caused by wrong linking order for the g++

For example:
"gcc test.c -lcurl" will build without error while "gcc -lcurl test.c" will fail because gcc/g++ not find the linkings.
This commit is contained in:
Krisztian Papp 2019-11-12 11:35:44 +01:00 committed by William Pierce
parent fe8854f86b
commit 587338c7fd

View File

@ -11,11 +11,11 @@ OBJS=$(addprefix ${OBJDIR}/,$(subst .cpp,.o,${CXXFILES}))
all: ${CURDIR}/bin/samrewritten
${CURDIR}/bin/samrewritten: $(OBJS)
${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${CURDIR}/bin/samrewritten $(OBJS)
${CXX} ${LDFLAGS} -o ${CURDIR}/bin/samrewritten $(OBJS) ${CXXFLAGS}
${OBJDIR}/%.o: %.cpp $(HFILES)
@mkdir -p $$(dirname $@)
$(CXX) $(CXXFLAGS) $< ${LDFLAGS} -c -o $@
clean:
${RMDIR} ${OBJDIR}
${RMDIR} ${OBJDIR}