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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1271 - (show annotations)
Thu May 28 18:46:19 2015 UTC (4 years, 6 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
2 # Quiet
3 #Q ?= @
4
5 RANLIB ?= ranlib
6
7 HOSTOS := $(shell uname -s)
8 ifeq ($(PLATFORM),)
9 PLATFORM := $(HOSTOS)
10 endif
11
12 ifeq ($(RELEASE),)
13 DEBUG = 1
14 CPPFLAGS += -D_DEBUG
15 else
16 CPPFLAGS += -DNDEBUG
17 endif
18
19 MATH_LIBS ?= -lm
20
21 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 RANLIB := $(CROSS_COMPILE)$(RANLIB)
29 WINDRES := $(CROSS_COMPILE)windres
30 CPPFLAGS += -DWIN32
31
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 ifeq ($(PLATFORM),Haiku)
42 CURSES_LIB := -lncurses
43 MATH_LIBS :=
44 endif
45
46 ifneq ($(PLATFORM),win32)
47 CURSES_LIB ?= -lcurses
48 STDCXX_LIB ?= -lstdc++
49 COMMON_EXTRA_LDFLAGS += $(CURSES_LIB) $(STDCXX_LIB)
50 CXXSTD ?= -std=c++11
51 CXXFLAGS += $(CXXSTD)
52 CPPFLAGS += -D__cdecl= -DPOSIX
53 CFLAGS += -Wall
54 endif
55
56
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