Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2105 | - | 1 | OBJ = main.o gpio.o uart.o processing.o flightcontrol.o timer.o flowcam.o |
2 | DEPS = main.h gpio.h uart.h types.h processing.h flightcontrol.h timer.h flowcam.h |
||
3 | LIBS = |
||
4 | CFLAGS = -std=c99 -Wall -export-dynamic -L/usr/lib/python2.7/config -lpython2.7 -lm -ldl -lutil -lpthread |
||
5 | CC = gcc |
||
6 | EXTENSION = .c |
||
7 | |||
8 | #define a rule that applies to all files ending in the .o suffix, which says that the .o file depends upon the .c version of the file and all the .h files included in the DEPS macro. Compile each object file |
||
9 | %.o: %$(EXTENSION) $(DEPS) |
||
10 | $(CC) -c -o $@ $< $(CFLAGS) |
||
11 | |||
12 | #Combine them into the output file |
||
13 | #Set your desired exe output file name here |
||
14 | all: ExPlat clean |
||
15 | |||
16 | ExPlat: $(OBJ) |
||
17 | $(CC) -o $@ $^ $(CFLAGS) $(LIBS) |
||
18 | |||
19 | #Cleanup |
||
20 | .PHONY: clean |
||
21 | |||
22 | clean: |
||
23 | rm -f *.o *~ core *~ |