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) ...@@ -273,14 +273,14 @@ all: $(PROJECT_LIBS_NAME) cfg $(OUT)
# Output Rule # Output Rule
$(OUT): $$($$@_OBJS) $(revision_OBJS) $(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 # Special rule for the revision object
$(revision_OBJS): $(revision_SRCS) $(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_NAME="\"$(GIT_USER_NAME)\"" \
-DGIT_USER_EMAIL="\"$(GIT_USER_EMAIL)\"" \ -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 # Pull in dependency info for *existing* .o files and don't complain if the
# corresponding .d file is not found # corresponding .d file is not found
...@@ -289,7 +289,7 @@ $(revision_OBJS): $(revision_SRCS) ...@@ -289,7 +289,7 @@ $(revision_OBJS): $(revision_SRCS)
# Autodependencies generatation by Scott McPeak, November 2001, # Autodependencies generatation by Scott McPeak, November 2001,
# from article "Autodependencies with GNU make" # from article "Autodependencies with GNU make"
%.o: %.c %.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" # create the dependency files "target: pre-requisites"
${CC} -MM $(CFLAGS) $(INCLUDE_DIRS) $*.c > $*.d ${CC} -MM $(CFLAGS) $(INCLUDE_DIRS) $*.c > $*.d
......
...@@ -59,7 +59,7 @@ OUT = $(basename $(examples_SRC)) ...@@ -59,7 +59,7 @@ OUT = $(basename $(examples_SRC))
all: $(OUT) all: $(OUT)
%: %.c %: %.c
$(CC) $(CFLAGS) $(INCLUDE_DIRS) $^ -o $@ $(LDFLAGS) $(LIBS) $(CC) $(LDFLAGS) $(CFLAGS) $(INCLUDE_DIRS) $^ -o $@ $(LIBS)
#BAD #BAD
clean: clean:
......
...@@ -206,14 +206,14 @@ all: $(TARGET_STATIC) $(TARGET_SHARED_VER) pre_inst ...@@ -206,14 +206,14 @@ all: $(TARGET_STATIC) $(TARGET_SHARED_VER) pre_inst
# Compile dynamic library # Compile dynamic library
%.so.$(LIB_VER): $$($$*_OBJS) $(revision_OBJS) %.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 # Special rule for the revision object
$(revision_OBJS): $(revision_SRCS) $(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_NAME="\"$(GIT_USER_NAME)\"" \
-DGIT_USER_EMAIL="\"$(GIT_USER_EMAIL)\"" \ -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 # Pull in dependency info for *existing* .o files and don't complain if the
# corresponding .d file is not found # corresponding .d file is not found
...@@ -223,7 +223,7 @@ $(revision_OBJS): $(revision_SRCS) ...@@ -223,7 +223,7 @@ $(revision_OBJS): $(revision_SRCS)
# Autodependencies generatation by Scott McPeak, November 2001, # Autodependencies generatation by Scott McPeak, November 2001,
# from article "Autodependencies with GNU make" # from article "Autodependencies with GNU make"
%.o: %.c %.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" # create the dependency files "target: pre-requisites"
${CC} -MM $(CFLAGS) $(INCLUDE_DIRS) $*.c > $*.d ${CC} -MM $(CFLAGS) $(INCLUDE_DIRS) $*.c > $*.d
......
...@@ -107,7 +107,7 @@ all: $(TARGET_STATIC) ...@@ -107,7 +107,7 @@ all: $(TARGET_STATIC)
# Autodependencies generatation by Scott McPeak, November 2001, # Autodependencies generatation by Scott McPeak, November 2001,
# from article "Autodependencies with GNU make" # from article "Autodependencies with GNU make"
%.o: %.c %.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" # create the dependency files "target: pre-requisites"
${CC} -MM $(CFLAGS) $(INCLUDE_DIRS) $*.c > $*.d ${CC} -MM $(CFLAGS) $(INCLUDE_DIRS) $*.c > $*.d
......
...@@ -107,7 +107,7 @@ all: $(TARGET_STATIC) ...@@ -107,7 +107,7 @@ all: $(TARGET_STATIC)
# Autodependencies generatation by Scott McPeak, November 2001, # Autodependencies generatation by Scott McPeak, November 2001,
# from article "Autodependencies with GNU make" # from article "Autodependencies with GNU make"
%.o: %.c %.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" # create the dependency files "target: pre-requisites"
${CC} -MM $(CFLAGS) $(INCLUDE_DIRS) $*.c > $*.d ${CC} -MM $(CFLAGS) $(INCLUDE_DIRS) $*.c > $*.d
......
...@@ -126,7 +126,7 @@ all: $(TARGET_STATIC) $(TARGET_SHARED_VER) ...@@ -126,7 +126,7 @@ all: $(TARGET_STATIC) $(TARGET_SHARED_VER)
# Compile dynamic library # Compile dynamic library
%.so.$(LIB_VER): $$($$*_OBJS) $(OBJ_REVISION) %.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 # Pull in dependency info for *existing* .o files and don't complain if the
# corresponding .d file is not found # corresponding .d file is not found
...@@ -136,7 +136,7 @@ all: $(TARGET_STATIC) $(TARGET_SHARED_VER) ...@@ -136,7 +136,7 @@ all: $(TARGET_STATIC) $(TARGET_SHARED_VER)
# Autodependencies generatation by Scott McPeak, November 2001, # Autodependencies generatation by Scott McPeak, November 2001,
# from article "Autodependencies with GNU make" # from article "Autodependencies with GNU make"
%.o: %.c %.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" # create the dependency files "target: pre-requisites"
${CC} -MM $(CFLAGS) $(INCLUDE_DIRS) $*.c > $*.d ${CC} -MM $(CFLAGS) $(INCLUDE_DIRS) $*.c > $*.d
......
...@@ -114,7 +114,7 @@ all: $(TARGET_STATIC) $(TARGET_SHARED_VER) ...@@ -114,7 +114,7 @@ all: $(TARGET_STATIC) $(TARGET_SHARED_VER)
# Compile dynamic library # Compile dynamic library
%.so.$(LIB_VER): $$($$*_OBJS) $(OBJ_REVISION) %.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 # Pull in dependency info for *existing* .o files and don't complain if the
# corresponding .d file is not found # corresponding .d file is not found
...@@ -124,7 +124,7 @@ all: $(TARGET_STATIC) $(TARGET_SHARED_VER) ...@@ -124,7 +124,7 @@ all: $(TARGET_STATIC) $(TARGET_SHARED_VER)
# Autodependencies generatation by Scott McPeak, November 2001, # Autodependencies generatation by Scott McPeak, November 2001,
# from article "Autodependencies with GNU make" # from article "Autodependencies with GNU make"
%.o: %.c %.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" # create the dependency files "target: pre-requisites"
${CC} -MM $(CFLAGS) $(INCLUDE_DIRS) $*.c > $*.d ${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