You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
620B

  1. CFLAGS = -std=c99 -Wall -g
  2. SOURCES = test.c
  3. ifndef ARCH
  4. $(error ARCH is not defined. Run with `make ARCH=mac`, win, or gtk2)
  5. endif
  6. SOURCES += osdialog.c
  7. ifeq ($(ARCH),gtk2)
  8. CFLAGS += $(shell pkg-config --cflags gtk+-2.0)
  9. LDFLAGS += $(shell pkg-config --libs gtk+-2.0)
  10. SOURCES += osdialog_gtk2.c
  11. endif
  12. ifeq ($(ARCH),win)
  13. # Windows
  14. LDFLAGS += -lcomdlg32
  15. SOURCES += osdialog_win.c
  16. endif
  17. ifeq ($(ARCH),mac)
  18. # MacOS
  19. LDFLAGS += -framework AppKit
  20. SOURCES += osdialog_mac.m
  21. CFLAGS += -mmacosx-version-min=10.7
  22. endif
  23. test: $(SOURCES)
  24. $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
  25. run: test
  26. ./test
  27. clean:
  28. rm -rfv test