Commit 92e983f2 authored by Lucas Russo's avatar Lucas Russo

*Makefile: move LDFLAGS options to first position in the compiler

This is the correct location for them, as they
would contain library paths.
parent 151b9f8a
......@@ -273,14 +273,14 @@ all: $(PROJECT_LIBS_NAME) cfg $(OUT)
# Output Rule
$(OUT): $$($$@_OBJS) $(revision_OBJS)
$(CC) $(CFLAGS) $(INCLUDE_DIRS) -o $@ $^ $($@_STATIC_LIBS) $(LDFLAGS) $(LIBS) $($@_LIBS) $(PROJECT_LIBS)
$(CC) $(LDFLAGS) $(CFLAGS) $(INCLUDE_DIRS) -o $@ $^ $($@_STATIC_LIBS) $(LIBS) $($@_LIBS) $(PROJECT_LIBS)
# Special rule for the revision object
$(revision_OBJS): $(revision_SRCS)
$(CC) $(CFLAGS) $(INCLUDE_DIRS) -DGIT_REVISION="\"$(GIT_REVISION)\"" \
$(CC) $(LDFLAGS) $(CFLAGS) $(INCLUDE_DIRS) -DGIT_REVISION="\"$(GIT_REVISION)\"" \
-DGIT_USER_NAME="\"$(GIT_USER_NAME)\"" \
-DGIT_USER_EMAIL="\"$(GIT_USER_EMAIL)\"" \
-c $< -o $@ $(LDFLAGS)
-c $< -o $@
# Pull in dependency info for *existing* .o files and don't complain if the
# corresponding .d file is not found
......@@ -289,7 +289,7 @@ $(revision_OBJS): $(revision_SRCS)
# Autodependencies generatation by Scott McPeak, November 2001,
# from article "Autodependencies with GNU make"
%.o: %.c
$(CC) $(CFLAGS) $(INCLUDE_DIRS) -c $*.c -o $@ $(LDFLAGS)
$(CC) $(LDFLAGS) $(CFLAGS) $(INCLUDE_DIRS) -c $*.c -o $@
# create the dependency files "target: pre-requisites"
${CC} -MM $(CFLAGS) $(INCLUDE_DIRS) $*.c > $*.d
......
......@@ -59,7 +59,7 @@ OUT = $(basename $(examples_SRC))
all: $(OUT)
%: %.c
$(CC) $(CFLAGS) $(INCLUDE_DIRS) $^ -o $@ $(LDFLAGS) $(LIBS)
$(CC) $(LDFLAGS) $(CFLAGS) $(INCLUDE_DIRS) $^ -o $@ $(LIBS)
#BAD
clean:
......
......@@ -206,14 +206,14 @@ all: $(TARGET_STATIC) $(TARGET_SHARED_VER) pre_inst
# Compile dynamic library
%.so.$(LIB_VER): $$($$*_OBJS) $(revision_OBJS)
$(CC) -shared -fPIC -Wl,-soname,$@ -o $@ $^ $(LDFLAGS) $(LIBS)
$(CC) $(LDFLAGS) -shared -fPIC -Wl,-soname,$@ -o $@ $^ $(LIBS)
# Special rule for the revision object
$(revision_OBJS): $(revision_SRCS)
$(CC) $(CFLAGS) $(INCLUDE_DIRS) -DGIT_REVISION="\"$(GIT_REVISION)\"" \
$(CC) $(LDFLAGS) $(CFLAGS) $(INCLUDE_DIRS) -DGIT_REVISION="\"$(GIT_REVISION)\"" \
-DGIT_USER_NAME="\"$(GIT_USER_NAME)\"" \
-DGIT_USER_EMAIL="\"$(GIT_USER_EMAIL)\"" \
-c $< -o $@ $(LDFLAGS)
-c $< -o $@
# Pull in dependency info for *existing* .o files and don't complain if the
# corresponding .d file is not found
......@@ -223,7 +223,7 @@ $(revision_OBJS): $(revision_SRCS)
# Autodependencies generatation by Scott McPeak, November 2001,
# from article "Autodependencies with GNU make"
%.o: %.c
$(CC) $(CFLAGS) $(INCLUDE_DIRS) -c $*.c -o $@ $(LDFLAGS)
$(CC) $(LDFLAGS) $(CFLAGS) $(INCLUDE_DIRS) -c $*.c -o $@
# create the dependency files "target: pre-requisites"
${CC} -MM $(CFLAGS) $(INCLUDE_DIRS) $*.c > $*.d
......
......@@ -107,7 +107,7 @@ all: $(TARGET_STATIC)
# Autodependencies generatation by Scott McPeak, November 2001,
# from article "Autodependencies with GNU make"
%.o: %.c
$(CC) $(CFLAGS) $(INCLUDE_DIRS) -c $*.c -o $@ $(LDFLAGS)
$(CC) $(LDFLAGS) $(CFLAGS) $(INCLUDE_DIRS) -c $*.c -o $@
# create the dependency files "target: pre-requisites"
${CC} -MM $(CFLAGS) $(INCLUDE_DIRS) $*.c > $*.d
......
......@@ -107,7 +107,7 @@ all: $(TARGET_STATIC)
# Autodependencies generatation by Scott McPeak, November 2001,
# from article "Autodependencies with GNU make"
%.o: %.c
$(CC) $(CFLAGS) $(INCLUDE_DIRS) -c $*.c -o $@ $(LDFLAGS)
$(CC) $(LDFLAGS) $(CFLAGS) $(INCLUDE_DIRS) -c $*.c -o $@
# create the dependency files "target: pre-requisites"
${CC} -MM $(CFLAGS) $(INCLUDE_DIRS) $*.c > $*.d
......
......@@ -126,7 +126,7 @@ all: $(TARGET_STATIC) $(TARGET_SHARED_VER)
# Compile dynamic library
%.so.$(LIB_VER): $$($$*_OBJS) $(OBJ_REVISION)
$(CC) -shared -fPIC -Wl,-soname,$@ -o $@ $^ $(LDFLAGS)
$(CC) $(LDFLAGS) -shared -fPIC -Wl,-soname,$@ -o $@ $^
# Pull in dependency info for *existing* .o files and don't complain if the
# corresponding .d file is not found
......@@ -136,7 +136,7 @@ all: $(TARGET_STATIC) $(TARGET_SHARED_VER)
# Autodependencies generatation by Scott McPeak, November 2001,
# from article "Autodependencies with GNU make"
%.o: %.c
$(CC) $(CFLAGS) $(INCLUDE_DIRS) -c $*.c -o $@ $(LDFLAGS)
$(CC) $(LDFLAGS) $(CFLAGS) $(INCLUDE_DIRS) -c $*.c -o $@
# create the dependency files "target: pre-requisites"
${CC} -MM $(CFLAGS) $(INCLUDE_DIRS) $*.c > $*.d
......
......@@ -114,7 +114,7 @@ all: $(TARGET_STATIC) $(TARGET_SHARED_VER)
# Compile dynamic library
%.so.$(LIB_VER): $$($$*_OBJS) $(OBJ_REVISION)
$(CC) -shared -fPIC -Wl,-soname,$@ -o $@ $^ $(LDFLAGS)
$(CC) $(LDFLAGS) -shared -fPIC -Wl,-soname,$@ -o $@ $^
# Pull in dependency info for *existing* .o files and don't complain if the
# corresponding .d file is not found
......@@ -124,7 +124,7 @@ all: $(TARGET_STATIC) $(TARGET_SHARED_VER)
# Autodependencies generatation by Scott McPeak, November 2001,
# from article "Autodependencies with GNU make"
%.o: %.c
$(CC) $(CFLAGS) $(INCLUDE_DIRS) -c $*.c -o $@ $(LDFLAGS)
$(CC) $(LDFLAGS) $(CFLAGS) $(INCLUDE_DIRS) -c $*.c -o $@
# create the dependency files "target: pre-requisites"
${CC} -MM $(CFLAGS) $(INCLUDE_DIRS) $*.c > $*.d
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment