Skip to content

Instantly share code, notes, and snippets.

@trainman419
Created February 16, 2013 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trainman419/4968375 to your computer and use it in GitHub Desktop.
Save trainman419/4968375 to your computer and use it in GitHub Desktop.
CFLAGS=-mmcu=$(DEVICE) -Wall -Werror -Iros_lib -O -DF_CPU=16000000UL -Idagny_protocol
LDFLAGS=-mmcu=$(DEVICE)
ASFLAGS=-mmcu=$(DEVICE)
CXXFLAGS=$(CFLAGS)
LDLIBS=-lm
CSRC=motor.c i2c.c estop.c
CXXSRC=gps.cpp interrupt.cpp main.cpp steer.cpp TinyGPS.cpp sonar.cpp imu.cpp protocol.cpp
DRIVERS=adc.o bump.o power.o pwm.o serial.o serial-interrupt.o servo.o
OBJS=$(CSRC:.c=.o) $(CXXSRC:.cpp=.o)
# implicit header dependency rules
.%.mk: %.c
$(CC) -MM $^ -MF $@
.%.mk: %.cpp
$(CXX) -MM $^ -MF $@
.PHONY: all
all: main
main: $(OBJS) $(DRIVERS)
.PHONY: clean
clean:
rm *.o *.i *.ii *.s *.hex || true
#include dependency rules
include $(CSRC:%.c=.%.mk)
include $(CXXSRC:%.cpp=.%.mk)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment