/[projet1]/public/pc/tools/rules.mk
Defence Force logotype

Annotation of /public/pc/tools/rules.mk

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1271 - (hide annotations)
Thu May 28 18:46:19 2015 UTC (4 years, 10 months ago) by mmu_man
File size: 1410 byte(s)
Hack an install target for OSDK binaries

FIXME: rules.mk should be included at the bottom of makefiles
TODO: install documentation and everything else as well

1 mmu_man 869
2 mmu_man 1271 # Quiet
3     #Q ?= @
4    
5 mmu_man 885 RANLIB ?= ranlib
6    
7 mmu_man 1265 HOSTOS := $(shell uname -s)
8     ifeq ($(PLATFORM),)
9     PLATFORM := $(HOSTOS)
10     endif
11 mmu_man 869
12 mmu_man 875 ifeq ($(RELEASE),)
13     DEBUG = 1
14     CPPFLAGS += -D_DEBUG
15     else
16     CPPFLAGS += -DNDEBUG
17     endif
18    
19 mmu_man 1264 MATH_LIBS ?= -lm
20    
21 mmu_man 869 ifeq ($(PLATFORM),win32)
22     EXE = .exe
23     .SUFFIXES: .exe
24     CROSS_COMPILE ?= i586-mingw32msvc-
25     CC := $(CROSS_COMPILE)$(CC)
26     CXX := $(CROSS_COMPILE)$(CXX)
27     AR := $(CROSS_COMPILE)$(AR)
28 mmu_man 885 RANLIB := $(CROSS_COMPILE)$(RANLIB)
29 mmu_man 869 WINDRES := $(CROSS_COMPILE)windres
30 mmu_man 875 CPPFLAGS += -DWIN32
31 mmu_man 869
32     # add default rules for exe files
33     %.exe: %.o
34     $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
35    
36     %.exe: %.c
37     $(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@
38    
39     endif
40    
41 mmu_man 1265 ifeq ($(PLATFORM),Haiku)
42     CURSES_LIB := -lncurses
43     MATH_LIBS :=
44     endif
45 mmu_man 869
46 mmu_man 883 ifneq ($(PLATFORM),win32)
47 mmu_man 1263 CURSES_LIB ?= -lcurses
48     STDCXX_LIB ?= -lstdc++
49     COMMON_EXTRA_LDFLAGS += $(CURSES_LIB) $(STDCXX_LIB)
50     CXXSTD ?= -std=c++11
51     CXXFLAGS += $(CXXSTD)
52 Jylam 1192 CPPFLAGS += -D__cdecl= -DPOSIX
53     CFLAGS += -Wall
54 mmu_man 883 endif
55 mmu_man 869
56 mmu_man 1271
57     ifneq ($(OSDK),)
58     #FIXME: This is a HACK to avoid install being the default target.
59     # TODO: move the include to bottom of makefiles
60     ifeq ($(MAKECMDGOALS),install)
61     #$(info OSDK=$(OSDK))
62     #ifneq ($(BINS),)
63     #$(info BINS=$(BINS))
64     install:
65     $(Q)install -d $(OSDK)/bin
66     $(Q)for B in $(BINS) $(EXECUTABLE); do install $$B $(OSDK)/bin/; done
67     $(Q)for B in $(BINS) $(EXECUTABLE); do b="`echo "$$B" | tr A-Z a-z`"; if [ "$$B" != "$$b" ]; then ln -sf "$$B" "$(OSDK)/bin/$$b"; fi; done
68    
69     endif
70     endif

  ViewVC Help
Powered by ViewVC 1.1.26