makefile 535 B

12345678910111213141516171819202122
  1. GTK_FLAGS = `pkg-config --cflags gtk+-3.0`
  2. GTK_LIBS = `pkg-config --libs gtk+-3.0`
  3. OBJECTS = $(patsubst src/%.c, build/%.o, $(wildcard src/*.c))
  4. run: build
  5. ./gtk_example
  6. clean:
  7. rm -f build/*.o gtk_example
  8. build: $(OBJECTS)
  9. gcc $(GTK_LIBS) build/*.o -o gtk_example
  10. build/builder.o: src/builder.c src/builder.h
  11. gcc -c $(GTK_FLAGS) src/builder.c -o build/builder.o
  12. build/logic.o: src/logic.c src/logic.h
  13. gcc -c $(GTK_FLAGS) src/logic.c -o build/logic.o
  14. build/main.o: src/main.c
  15. gcc -c $(GTK_FLAGS) src/main.c -o build/main.o