GNUmakefile 1.82 KB
Newer Older
deuce's avatar
deuce committed
1
2
3
4
SRC_ROOT = ..
# Cross platform/compiler definitions
include $(SRC_ROOT)/build/Common.gmake	# defines clean and output directory rules

5
CFLAGS += $(XPDEV-MT_CFLAGS) $(ENCODE_CFLAGS) $(CIOLIB-MT_CFLAGS)
deuce's avatar
deuce committed
6

7
ifeq ($(os),win32)
8
 OBJS	+=	$(MTOBJODIR)$(DIRSEP)SDL_win32_main$(OFILE)
9
 OBJS	+=	$(MTOBJODIR)$(DIRSEP)win32cio$(OFILE)
10
 OBJS	+=	$(MTOBJODIR)$(DIRSEP)ciolib_res$(OFILE)
11
else
12
13
 OBJS	+=	$(MTOBJODIR)$(DIRSEP)curs_cio$(OFILE)
endif
deuce's avatar
deuce committed
14
15
16
ifdef NO_X
 CFLAGS	+=	-DNO_X
else
deuce's avatar
deuce committed
17
 OBJS	+=	$(MTOBJODIR)$(DIRSEP)x_events$(OFILE) \
deuce's avatar
deuce committed
18
			$(MTOBJODIR)$(DIRSEP)x_cio$(OFILE)
deuce's avatar
deuce committed
19
 NEED_BITMAP := 1
deuce's avatar
deuce committed
20
endif
21

deuce's avatar
deuce committed
22
ifdef WITH_SDL_AUDIO
23
 OBJS	+=	$(MTOBJODIR)$(DIRSEP)sdl_con$(OFILE)
deuce's avatar
deuce committed
24
25
26
 ifeq ($(os),darwin)
  OBJS 	+=      $(MTOBJODIR)$(DIRSEP)pasteboard$(OFILE)
 endif
deuce's avatar
deuce committed
27
 NEED_BITMAP := 1
deuce's avatar
deuce committed
28
29
else
 ifdef WITH_SDL
deuce's avatar
deuce committed
30
  NEED_BITMAP := 1
deuce's avatar
deuce committed
31
32
33
  OBJS	+=	$(MTOBJODIR)$(DIRSEP)sdl_con$(OFILE)
  OBJS	+=      $(MTOBJODIR)$(DIRSEP)sdlfuncs$(OFILE)
 endif
34
35
endif

36
ifeq ($(os),netbsd)
37
38
39
 ifndef USE_SYSTEM_CURSES
  CFLAGS	+=	-DN_CURSES_LIB
 endif
40
endif
deuce's avatar
deuce committed
41

deuce's avatar
deuce committed
42
ifeq ($(shell if [ -e /usr/include/ncursesw/ncurses.h ] ; then echo YES ; fi),YES)
43
44
45
 CFLAGS += -DDEBIAN_HATES_YOU
endif

deuce's avatar
deuce committed
46
47
48
ifdef NEED_BITMAP
 OBJS	+=	$(MTOBJODIR)$(DIRSEP)bitmap_con$(OFILE)
endif
49

deuce's avatar
deuce committed
50
# CIOLIB Library Link Rule
deuce's avatar
deuce committed
51
$(CIOLIB-MT_BUILD): $(MTOBJODIR) $(OBJS)
deuce's avatar
deuce committed
52
	@echo Creating $@ ...
deuce's avatar
deuce committed
53
54
	$(QUIET)$(AR) rc $@ $(OBJS)
	$(QUIET)$(RANLIB) $@
deuce's avatar
deuce committed
55

deuce's avatar
deuce committed
56
$(CIOLIB-MT_SHLIB_BUILD): $(MTOBJODIR) $(OBJS)
deuce's avatar
deuce committed
57
58
	@echo Creating $@
	$(QUIET)$(MKSHLIB) $(LDFLAGS) $(OBJS) $(SHLIBOPTS) -o $@
deuce's avatar
deuce committed
59
60

ifeq ($(os),darwin)
61
62
63
$(MTOBJODIR)$(DIRSEP)pasteboard$(OFILE): pasteboard.m
	@echo $(COMPILE_MSG) $<
	$(QUIET)$(CC) $(CFLAGS) $(CCFLAGS) -o $@ -c $<
deuce's avatar
deuce committed
64
65
endif

66
67
68
69
70
71
72
ifeq ($(os),win32)
mtlib: $(MTOBJODIR)$(DIRSEP)ciolib_res${OFILE}

dl-mtlib: $(MTOBJODIR)$(DIRSEP)ciolib_res${OFILE}

$(MTOBJODIR)$(DIRSEP)ciolib_res${OFILE}: ciolib.rc syncicon64.ico
	@echo Creating $< ...
73
	$(QUIET)${WINDRES} -O coff -i ciolib.rc -o $@
74
endif