-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
54 lines (37 loc) · 1.22 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# FileName :Makefile
# Description :Generates executables in ~/APES_Beaglebone_linux Takes .h files from ~/APES_Beaglebone_linux_project/inc
# path
# File Author Name:Divya Sampath Kumar, Bhallaji Venkatesan
# Reference :http://ecee.colorado.edu/~ecen5623/ecen/ex/Linux/example-1/Makefile
INCLUDE_DIRS = -Iinc
CC=arm-linux-gnueabihf-gcc
#CC=gcc
CFLAGS= -O0 -g -w $(INCLUDE_DIRS) -pthread
LIBS = -lrt -lm
OUTPUT=main_exec
#OUTPUT=i2c_light.o
#Will be added as we add on header and C files
HFILES= message.h fw_i2c.h
CFILES= src/main.c
#CFILES= src/main.c src/i2c-drive.c
SRCS = $(wildcard src/*.c)
OBJECTS = $(patsubst %.c,%.o,$(SRCS))
all: ${OUTPUT}
#OUTPUT to be filled later on
led.o:$(OBJECTS)
$(CC) $(CFLAGS) -o $@ led.o $(LIBS)
i2c_drive.o:$(OBJECTS)
$(CC) $(CFLAGS) -o $@ i2c-drive.o $(LIBS)
i2c_temp.o:$(OBJECTS)
$(CC) $(CFLAGS) -o $@ i2c-temp.o $(LIBS)
i2c_light.o:$(OBJECTS)
$(CC) $(CFLAGS) -o $@ i2c-light.o $(LIBS)
main_exec:$(OBJECTS)
$(CC) $(CFLAGS) -o $@ main.o i2c-drive.o i2c-temp.o i2c-light.o led.o $(LIBS)
#i2c_drive:$(OBJECTS)
# $(CC) $(CFLAGS) -o $@ i2c-drive.o $(LIBS)
clean:
-rm -f *.o *.NEW *~ *.d
-rm -f ${OUTPUT} ${GARBAGE}
$(OBJECTS):src/%.o : src/%.c
$(CC) $(CFLAGS) -c $<