about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2016-01-20 02:58:29 +0000
committerRich Felker <dalias@aerifal.cx>2016-01-20 02:58:29 +0000
commitada4798df0863226ec057a0e07285fe6820b73bd (patch)
treedfdda97635ce50a810ba696d19b21891a83c7a87
parent80de11bc6b08ae537a014ecf5a9e7386c89b17bd (diff)
downloadmusl-ada4798df0863226ec057a0e07285fe6820b73bd.tar.gz
musl-ada4798df0863226ec057a0e07285fe6820b73bd.tar.xz
musl-ada4798df0863226ec057a0e07285fe6820b73bd.zip
deduplicate compiler invocation command line in makefile
also clean up duplication of CFLAGS passing to assembler.
-rw-r--r--Makefile16
1 files changed, 9 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 7849c93f..24c418ad 100644
--- a/Makefile
+++ b/Makefile
@@ -130,30 +130,32 @@ $(CRT_LIBS:lib/%=obj/crt/%): CFLAGS_ALL += -DCRT
 
 $(LOBJS): CFLAGS_ALL += -fPIC -DSHARED
 
+CC_CMD = $(CC) $(CFLAGS_ALL) -c -o $@ $<
+
 # Choose invocation of assembler to be used
 ifeq ($(ADD_CFI),yes)
 	AS_CMD = LC_ALL=C awk -f $(srcdir)/tools/add-cfi.common.awk -f $(srcdir)/tools/add-cfi.$(ARCH).awk $< | $(CC) $(CFLAGS_ALL) -x assembler -c -o $@ -
 else
-	AS_CMD = $(CC) $(CFLAGS_ALL) -c -o $@ $<
+	AS_CMD = $(CC_CMD)
 endif
 
 obj/%.o: $(srcdir)/%.s
-	$(AS_CMD) $(CFLAGS_ALL)
+	$(AS_CMD)
 
 obj/%.o: $(srcdir)/%.S
-	$(CC) $(CFLAGS_ALL) -c -o $@ $<
+	$(CC_CMD)
 
 obj/%.o: $(srcdir)/%.c $(GENH) $(IMPH)
-	$(CC) $(CFLAGS_ALL) -c -o $@ $<
+	$(CC_CMD)
 
 obj/%.lo: $(srcdir)/%.s
-	$(AS_CMD) $(CFLAGS_ALL)
+	$(AS_CMD)
 
 obj/%.lo: $(srcdir)/%.S
-	$(CC) $(CFLAGS_ALL) -c -o $@ $<
+	$(CC_CMD)
 
 obj/%.lo: $(srcdir)/%.c $(GENH) $(IMPH)
-	$(CC) $(CFLAGS_ALL) -c -o $@ $<
+	$(CC_CMD)
 
 lib/libc.so: $(LOBJS)
 	$(CC) $(CFLAGS_ALL) $(LDFLAGS_ALL) -nostdlib -shared \