Tupfile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. CFLAGS = -I /usr/local/include -I ./include -Wall --std=c99 -Wno-unused
  2. ifeq (@(RELEASE),y)
  3. CFLAGS += -Os
  4. else
  5. CFLAGS += -g
  6. endif
  7. # Source files of EKQ
  8. SRC_FILES = src/libtelnet.c
  9. SRC_FILES += src/config.c
  10. SRC_FILES += src/esh.c
  11. SRC_FILES += src/timer.c
  12. SRC_FILES += src/client.c
  13. SRC_FILES += src/mem.c
  14. SRC_FILES += src/every.c
  15. SRC_FILES += src/dynar.c
  16. SRC_FILES += src/monolog.c
  17. SRC_FILES += src/server.c
  18. SRC_FILES += src/tr_file.c
  19. SRC_FILES += src/rh.c
  20. SRC_FILES += src/toruby.c
  21. # SRC_FILES += src/tr.c
  22. TEST_FILES = test/test_model.c
  23. += test/test_objfile.c
  24. MAIN_FILE = src/main.c
  25. MRUBY_LIBS = -lmruby_core -lmruby
  26. WOE_LIBS = $(MRUBY_LIBS) -lrt -lm
  27. LDFLAGS = -L /usr/local/lib $(WOE_LIBS)
  28. !cc = |> ^ CC %f ^ gcc $(CFLAGS) -c %f -o %o |>
  29. !ld = |> gcc %f $(LDFLAGS) -o %o |>
  30. : foreach $(SRC_FILES) |> !cc |> build/obj/%B.o {objects}
  31. : $(MAIN_FILE) |> !cc |> build/main/%B.o {main}
  32. : {objects} {main} |> !ld |> bin/woe-server
  33. !ld_test = |> gcc %f $(LDFLAGS) -o %o |>
  34. # Compile and link tests. Vexingly foreach seems of no avail for the
  35. # linking step.
  36. #
  37. # : foreach $(TEST_FILES) |> !cc |> build/test/%B.o {test_objects}
  38. # : {objects} build/test/test_model.o |> !ld |> bin/test_model
  39. # : test/test_objfile.c |> !cc |> build/test/%B.o {test_objects}
  40. # : {objects} build/test/test_objfile.o |> !ld |> bin/test_objfile
  41. # : foreach $(TEST_FILES) |> echo %f |>
  42. # ^ LINK %f ^