Browse Source

build: Allow changing CC even when CROSS is set.

Georgi Chorbadzhiyski 6 years ago
parent
commit
9c89a5e2ff
1 changed files with 7 additions and 6 deletions
  1. 7 6
      Makefile

+ 7 - 6
Makefile View File

@@ -1,6 +1,7 @@
1
-CC = $(CROSS)$(TARGET)gcc
2
-LINK = $(CROSS)$(TARGET)ld -o
3
-MKDEP = $(CC) -M -o $*.d $<
1
+CC = cc
2
+LINK = ld -o
3
+CROSS := $(TARGET)
4
+MKDEP = $(CROSS)$(CC) -M -o $*.d $<
4 5
 
5 6
 LIBRARY_LINK_OPTS =  -L. -r
6 7
 CFLAGS = -O2 -ggdb -std=c99 -D_GNU_SOURCE
@@ -28,16 +29,16 @@ all: $(PROG)
28 29
 
29 30
 $(PROG): $(OBJS) tsdata.h tsfuncs.h
30 31
 	$(Q)echo "  LINK	$(PROG)"
31
-	$(Q)$(LINK) $@ $(LIBRARY_LINK_OPTS) $(OBJS)
32
+	$(Q)$(CROSS)$(LINK) $@ $(LIBRARY_LINK_OPTS) $(OBJS)
32 33
 
33 34
 tstest: $(tstest_OBJS)
34 35
 	$(Q)echo "  LINK	tstest"
35
-	$(Q)$(CC) $(CFLAGS) $(tstest_OBJS) -o tstest
36
+	$(Q)$(CROSS)$(CC) $(CFLAGS) $(tstest_OBJS) -o tstest
36 37
 
37 38
 %.o: %.c tsdata.h tsfuncs.h
38 39
 	@$(MKDEP)
39 40
 	$(Q)echo "  CC	libtsfuncs	$<"
40
-	$(Q)$(CC) $(CFLAGS) -c $<
41
+	$(Q)$(CROSS)$(CC) $(CFLAGS) -c $<
41 42
 
42 43
 -include $(OBJS:.o=.d)
43 44