GNUmakefile 1.66 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

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

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
 NEED_BITMAP := 1
deuce's avatar
deuce committed
25
26
else
 ifdef WITH_SDL
deuce's avatar
deuce committed
27
  NEED_BITMAP := 1
deuce's avatar
deuce committed
28
29
30
  OBJS	+=	$(MTOBJODIR)$(DIRSEP)sdl_con$(OFILE)
  OBJS	+=      $(MTOBJODIR)$(DIRSEP)sdlfuncs$(OFILE)
  ifeq ($(os),darwin)
31
   OBJS 	+=      $(MTOBJODIR)$(DIRSEP)SDLMain$(OFILE)
deuce's avatar
deuce committed
32
33
  endif
 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
43
44
ifdef NEED_BITMAP
 OBJS	+=	$(MTOBJODIR)$(DIRSEP)bitmap_con$(OFILE)
endif
45

deuce's avatar
deuce committed
46
# CIOLIB Library Link Rule
deuce's avatar
deuce committed
47
$(CIOLIB-MT_BUILD): $(MTOBJODIR) $(OBJS)
deuce's avatar
deuce committed
48
	@echo Creating $@ ...
deuce's avatar
deuce committed
49
50
	$(QUIET)$(AR) rc $@ $(OBJS)
	$(QUIET)$(RANLIB) $@
deuce's avatar
deuce committed
51

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

ifeq ($(os),darwin)
$(MTOBJODIR)$(DIRSEP)SDLMain$(OFILE): SDLMain.m
	@echo $(COMPILE_MSG) $<
deuce's avatar
deuce committed
59
	$(QUIET)$(CC) $(CFLAGS) $(CCFLAGS) -o $@ -c $<
deuce's avatar
deuce committed
60
61
endif

62
63
64
65
66
67
68
69
70
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 $< ...
	$(QUIET)${WINDRES} ciolib.rc $@
endif