2 # Should be fairly portable for the various *nix systems. The rules
3 # themselves shouldn't need to be changed; only the variables may need to
6 # Automatically default to a release build.
12 VERSION
= $(shell cat VERSION
)
13 GIT_BUILD
= $(shell git describe
)
15 # Git command to make a distribution tarball.
16 GIT_ARCHIVE
= git archive
--format
=tar --prefix=rpn-
$(VERSION
)/ HEAD | \
17 bzip2
>rpn-
$(VERSION
).
tar.bz2
20 CXXFLAGS
= -Wall
-Weffc
++ -pedantic
-O2
-DRPN_CONSOLE
-DRPN_LONG_DOUBLE \
21 -DGIT_BUILD
="\"$(GIT_BUILD)\""
25 CXXFLAGS
= -Wall
-Weffc
++ -pedantic
-g
-DRPN_CONSOLE
-DRPN_LONG_DOUBLE \
26 -DGIT_BUILD
=$(GIT_BUILD
)
32 TARGET
= bin
/console
/rpn
34 $(OBJDIR
)Calculator.o
$(OBJDIR
)Commands.o
$(OBJDIR
)Help.o \
35 $(OBJDIR
)History.o
$(OBJDIR
)Main.o
$(OBJDIR
)Operators.o \
36 $(OBJDIR
)Variables.o
$(OBJDIR
)console
/Arguments.o
38 # make the program by default
42 # rule to clean-up the objects and the target, if they exist
45 @echo Cleaning objects and executables...
46 @
$(RM
) $(OBJECTS
) $(TARGET
)
48 # General rule for compiling.
49 $(OBJDIR
)%.o
: $(SRCDIR
)%.
cpp $(SRCDIR
)rpn.h
50 @echo Compiling
$(notdir $<)
51 @
$(CXX
) $(CXXFLAGS
) -c
-o
$@
$<
53 # rule to make the program
55 @echo Linking
$(TARGET
)...
56 @
$(CXX
) $(OBJECTS
) $(LFLAGS
) $@
58 # rule to make tarball for distribution.
63 # rule to make documentation
69 PSP_TARGET
= EBOOT.PBP
70 PSP_MAKEFILE
= Makefile.psp
72 # Call the PSP makefile to do the work.
73 $(PSP_TARGET
): $(PSP_MAKEFILE
)
76 # Make the executable.
83 @
$(MAKE
) -f
$(PSP_MAKEFILE
) clean
87 @
$(MAKE
) -f
$(PSP_MAKEFILE
) install
90 WII_MAKEFILE
= Makefile.wii
94 @
$(MAKE
) -f
$(WII_MAKEFILE
)
97 wii-clean
: $(WII_MAKEFILE
)
98 @
$(MAKE
) -f
$(WII_MAKEFILE
) clean
101 wii-run
: $(WII_MAKEFILE
)
102 @
$(MAKE
) -f
$(WII_MAKEFILE
) run
104 # An easter egg, just for the hell of it.