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
-pedantic
-O2
-DRPN_CONSOLE
24 CXXFLAGS
= -Wall
-pedantic
-g
-DRPN_CONSOLE
31 $(SRCDIR
)Calculator.o
$(SRCDIR
)Commands.o
$(SRCDIR
)History.o \
32 $(SRCDIR
)Main.o
$(SRCDIR
)Operators.o
$(SRCDIR
)Variables.o
34 # make the program by default
38 # rule to clean-up the objects and the target, if they exist
41 @echo Cleaning objects and executables...
42 @
$(RM
) $(OBJECTS
) $(TARGET
)
44 # General rule for compiling.
45 $(SRCDIR
)%.o
: $(SRCDIR
)%.
cpp $(SRCDIR
)rpn.h
46 @echo Compiling
$(notdir $<)
47 @
$(CXX
) $(CXXFLAGS
) -c
-o
$@
$<
49 # rule to make the program
51 @echo Linking
$(TARGET
)...
52 @
$(CXX
) $(OBJECTS
) $(LFLAGS
) $@
54 # rule to make tarball for distribution.
59 # rule to make documentation
64 # An easter egg, just for the hell of it.