Advertisement
tm512

Untitled

Mar 30th, 2011
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. # obsidian Makefile
  2. # my first Makefile :(
  3.  
  4. SHELL=/bin/sh
  5. CC=gcc
  6. MKDIR=mkdir -p
  7.  
  8. OBJ_D=obj
  9. OPT_LEVEL=0
  10. DGB_LEVEL=3
  11.  
  12. # Windows build? (make sure to set CC to the mingw compiler)
  13. win32 := false
  14. # Linux, FreeBSD, etc. (default)
  15. nix := true
  16.  
  17. # GNU make?
  18. ifeq ($(strip $(shell make -v |grep "GNU")),)
  19. $(warning WARNING: You are using non-gnu make, try "gmake" if build fails)
  20. endif
  21.  
  22. INCLUDES = -Itextscreen -Iopl -Isrc -Ipcsound -Ienet/include $(shell sdl-config --cflags)
  23. LIBS = $(shell sdl-config --libs)
  24. OBS_LIBS = $(LIBS) enet/.libs/libenet.a -lSDL_mixer
  25.  
  26. ifeq ($(strip $(win32)), true)
  27. LIBS += -mwindows -lws2_32 -lwinmm
  28. endif
  29.  
  30. # Textscreen stuffs
  31. TXT_SOURCES = $(wildcard textscreen/*.c)
  32. TXT_HEADERS = $(wildcard textscreen/*.h)
  33. TXT_OBJS = $(patsubst textscreen/%.c,$(OBJ_D)/textscreen/%.o,$(TXT_SOURCES))
  34.  
  35. default: all
  36. all: textscreen
  37.  
  38. $(TXT_OBJS): $(TXT_SOURCES)
  39. @$(MKDIR) $(dir $@)
  40. $(CC) $(INCLUDES) -c $< -o $@
  41.  
  42. textscreen: $(TXT_OBJS)
  43. $(CC) $(INCLUDES) $(LIBS) $(TXT_OBJS) -o textscreen/libtextscreen.a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement