2
#___________________________________________________________________________
6
# (better to specify these in environment/command line)
8
#export STATICLIBS := 1
10
# Target binary/library
23
# Subdirectories to make
33
CFLAGS := $(if $(DEBUGMODE),-g -D DEBUG,-O2)
34
CXXFLAGS := $(if $(DEBUGMODE),-g -D DEBUG,-O2)
35
ASFLAGS := -f elf $(if $(DEBUGMODE),-g -dDEBUG,-O2)
36
LDFLAGS := -Wall $(if $(DEBUGMODE),,-s) $(if $(STATICLIBS), -static)
38
#___________________________________________________________________________
41
_SRCS := $(CC_SRCS) $(C_SRCS) $(S_SRCS)
42
_OBJS := $(addsuffix .o,$(basename $(_SRCS)))
43
LDLIBS := $(addprefix -l,$(LIBRARIES))
45
.PHONY: all target clean clean_all run depend dep $(SUBDIRS)
47
all: $(SUBDIRS) $(TARGET)
9
CC_SRCS = simplecrypt.cc
20
#---------------------------------------------------------------------------
21
# Edam's makefile r1.02
25
SRCS = $(C_SRCS) $(CC_SRCS) $(S_SRCS)
26
OBJS = $(addsuffix .o,$(basename $(SRCS)))
30
g++ -o $(TARGET) $(OBJS) $(LDFLAGS)
32
#---------------------------------------------------------------------------
34
.PHONY: all clean depend dep
36
all: clean depend $(TARGET)
52
ifeq ($(MAKECMDGOALS),clean)
54
@echo NOT RECURSING: Use \"make clean_all\" to clean recursively..."
57
rm -f core $(DEPFILE) $(_OBJS) $(TARGET)
39
rm -f core $(DEPFILE) $(OBJS)
60
clean_all: $(SUBDIRS) clean
63
$(if $(BUILDLIB),@echo Can\'t run a library\!,./$(TARGET))
66
# makedepend -f- -- $(CPPFLAGS) -- $(_SRCS) > $(DEPFILE)
69
@$(MAKE) --no-print-directory -C $@ $(MAKECMDGOALS)
73
$(AR) rcs $(TARGET) $(_OBJS)
75
$(CC) $(if $(BUILDSO),-shared) -o $(TARGET) $(LDFLAGS) $(_OBJS) $(LDLIBS)
79
# $(CC) -c $(CPPFLAGS) $(CFLAGS)
81
# $(CXX) -c $(CPPFLAGS) $(CXXFLAGS)
87
#___________________________________________________________________________
43
makedepend -f- -- $(CFLAGS) -- $(SRCS) > $(DEPFILE)
45
#---------------------------------------------------------------------------