Skip to content
Snippets Groups Projects
GNUmakefile 2.08 KiB
Newer Older
deuce's avatar
deuce committed
SRC_ROOT = ..
# Cross platform/compiler definitions
include $(SRC_ROOT)/build/Common.gmake	# defines clean and output directory rules

CFLAGS += $(XPDEV-MT_CFLAGS) $(HASH_CFLAGS) $(ENCODE_CFLAGS) $(CIOLIB-MT_CFLAGS)
ifeq ($(os),win32)
Deucе's avatar
Deucе committed
 ifndef WITHOUT_GDI
  OBJS	+=	$(MTOBJODIR)$(DIRSEP)win32gdi$(OFILE)
  NEED_BITMAP := 1
 OBJS	+=	$(MTOBJODIR)$(DIRSEP)SDL_win32_main$(OFILE)
 OBJS	+=	$(MTOBJODIR)$(DIRSEP)win32cio$(OFILE)
 OBJS	+=	$(MTOBJODIR)$(DIRSEP)ciolib_res$(OFILE)
 OBJS	+=	$(MTOBJODIR)$(DIRSEP)curs_cio$(OFILE)
endif
deuce's avatar
deuce committed
ifdef NO_X
 CFLAGS	+=	-DNO_X
else
Deucе's avatar
Deucе committed
 OBJS	+=	$(MTOBJODIR)$(DIRSEP)x_events$(OFILE)
 OBJS	+=      $(MTOBJODIR)$(DIRSEP)x_cio$(OFILE)
deuce's avatar
deuce committed
 NEED_BITMAP := 1
deuce's avatar
deuce committed
endif
ifdef WITH_SDL
 NEED_BITMAP := 1
 OBJS	+=	$(MTOBJODIR)$(DIRSEP)sdl_con$(OFILE)
 OBJS	+=      $(MTOBJODIR)$(DIRSEP)sdlfuncs$(OFILE)
ifeq ($(os),netbsd)
 ifndef USE_SYSTEM_CURSES
  CFLAGS	+=	-DN_CURSES_LIB
 endif
deuce's avatar
deuce committed

deuce's avatar
deuce committed
ifeq ($(shell if [ -e /usr/include/ncursesw/ncurses.h ] ; then echo YES ; fi),YES)
deuce's avatar
deuce committed
ifdef NEED_BITMAP
Deucе's avatar
Deucе committed
 OBJS	+=	$(MTOBJODIR)$(DIRSEP)bitmap_con$(OFILE)
 OBJS	+=	$(MTOBJODIR)$(DIRSEP)scale$(OFILE)
 OBJS	+=	$(MTOBJODIR)$(DIRSEP)xbr$(OFILE)
deuce's avatar
deuce committed
endif
deuce's avatar
deuce committed
# CIOLIB Library Link Rule
$(CIOLIB-MT_BUILD): $(MTOBJODIR) $(OBJS) $(CIOLIB_INTERPOLATE_TARGET)
deuce's avatar
deuce committed
	@echo Creating $@ ...
deuce's avatar
deuce committed
	$(QUIET)$(AR) rc $@ $(OBJS)
	$(QUIET)$(RANLIB) $@
deuce's avatar
deuce committed

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

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 $< ...
Deucе's avatar
Deucе committed
	$(QUIET)${WINDRES} $(WINDRESFLAGS) -O coff -i ciolib.rc -o $@
Deucе's avatar
Deucе committed

genamp: $(EXEODIR) $(MTOBJODIR) $(EXEODIR)$(DIRSEP)genmap$(EXEFILE)

$(EXEODIR)$(DIRSEP)genmap$(EXEFILE): $(MTOBJODIR)$(DIRSEP)genmap$(OFILE) $(MTOBJODIR)$(DIRSEP)scale$(OFILE) $(MTOBJODIR)$(DIRSEP)xbr$(OFILE)
	$(CC) $(LDFLAGS) $(MT_LDFLAGS) $(MTOBJODIR)$(DIRSEP)genmap$(OFILE) $(MTOBJODIR)$(DIRSEP)scale$(OFILE) $(MTOBJODIR)$(DIRSEP)xbr$(OFILE) -o $@ -lm