Makefile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Makefile for GPS Test Tool (PC Application)
  2. CC = gcc
  3. CFLAGS = -Wall -Wextra -g -O2 -I. -I../soft -DPC_BUILD
  4. LDFLAGS = -lm
  5. TARGET = gps-test-tool
  6. SOURCES = main.c gpx_wrapper.c nmea_actual_wrapper.c
  7. OBJECTS = $(SOURCES:.c=.o)
  8. .PHONY: all clean
  9. all: $(TARGET)
  10. $(TARGET): $(OBJECTS)
  11. $(CC) $(OBJECTS) -o $(TARGET) $(LDFLAGS)
  12. @echo ""
  13. @echo "Build complete! Run with:"
  14. @echo " ./$(TARGET) <input.nmea>"
  15. %.o: %.c avr_compat.h
  16. $(CC) $(CFLAGS) -c $< -o $@
  17. clean:
  18. rm -f $(OBJECTS) $(TARGET) output_*.gpx debug_*.txt
  19. test: $(TARGET)
  20. @echo "Running test with sample NMEA data..."
  21. @echo "Creating sample NMEA file..."
  22. @echo '$$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A' > test.nmea
  23. @echo '$$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47' >> test.nmea
  24. @echo '$$GPRMC,123520,A,4807.039,N,01131.001,E,022.4,084.4,230394,003.1,W*60' >> test.nmea
  25. @echo '$$GPGGA,123520,4807.039,N,01131.001,E,1,08,0.9,546.2,M,46.9,M,,*48' >> test.nmea
  26. ./$(TARGET) test.nmea
  27. @echo ""
  28. @echo "Test complete! Check output_*.gpx and debug_*.txt"
  29. .PHONY: help
  30. help:
  31. @echo "GPS Test Tool - Build System"
  32. @echo ""
  33. @echo "Targets:"
  34. @echo " all (default) - Build the gps-test-tool executable"
  35. @echo " clean - Remove built files and output"
  36. @echo " test - Build and run with sample data"
  37. @echo " help - Show this help message"
  38. @echo ""
  39. @echo "Usage:"
  40. @echo " make # Build"
  41. @echo " make test # Build and test"
  42. @echo " ./gps-test-tool <input.nmea> # Run"