Makefile 314 B

123456789101112131415161718192021
  1. CC=gcc
  2. CFLAGS=-g `sdl-config --cflags`
  3. LDFLAGS=`sdl-config --libs` -lpng
  4. SOURCES=savepng.c main.c
  5. EXECUTABLE=savepng
  6. OBJECTS=$(SOURCES:.c=.o)
  7. all: $(SOURCES) $(EXECUTABLE)
  8. $(EXECUTABLE): $(OBJECTS)
  9. $(CC) $(OBJECTS) -o $@ $(LDFLAGS)
  10. .c.o:
  11. $(CC) -c $(CFLAGS) $< -o $@
  12. clean:
  13. rm -rf *.o *.a $(EXECUTABLE)