| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- # Makefile for GPS Test Tool (PC Application)
- CC = gcc
- CFLAGS = -Wall -Wextra -g -O2 -I. -I../soft -DPC_BUILD
- LDFLAGS = -lm
- TARGET = gps-test-tool
- SOURCES = main.c gpx_wrapper.c nmea_actual_wrapper.c
- OBJECTS = $(SOURCES:.c=.o)
- .PHONY: all clean
- all: $(TARGET)
- $(TARGET): $(OBJECTS)
- $(CC) $(OBJECTS) -o $(TARGET) $(LDFLAGS)
- @echo ""
- @echo "Build complete! Run with:"
- @echo " ./$(TARGET) <input.nmea>"
- %.o: %.c avr_compat.h
- $(CC) $(CFLAGS) -c $< -o $@
- clean:
- rm -f $(OBJECTS) $(TARGET) output_*.gpx debug_*.txt
- test: $(TARGET)
- @echo "Running test with sample NMEA data..."
- @echo "Creating sample NMEA file..."
- @echo '$$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A' > test.nmea
- @echo '$$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47' >> test.nmea
- @echo '$$GPRMC,123520,A,4807.039,N,01131.001,E,022.4,084.4,230394,003.1,W*60' >> test.nmea
- @echo '$$GPGGA,123520,4807.039,N,01131.001,E,1,08,0.9,546.2,M,46.9,M,,*48' >> test.nmea
- ./$(TARGET) test.nmea
- @echo ""
- @echo "Test complete! Check output_*.gpx and debug_*.txt"
- .PHONY: help
- help:
- @echo "GPS Test Tool - Build System"
- @echo ""
- @echo "Targets:"
- @echo " all (default) - Build the gps-test-tool executable"
- @echo " clean - Remove built files and output"
- @echo " test - Build and run with sample data"
- @echo " help - Show this help message"
- @echo ""
- @echo "Usage:"
- @echo " make # Build"
- @echo " make test # Build and test"
- @echo " ./gps-test-tool <input.nmea> # Run"
|