2000-02-25 10:15:17 +00:00
|
|
|
# -*- makefile -*-
|
|
|
|
|
2002-06-10 06:24:11 +00:00
|
|
|
.PHONY: all clean sourcelist
|
2000-02-25 10:15:17 +00:00
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
include $(TOP)/GNUmakef.def
|
|
|
|
|
2000-08-23 19:24:19 +00:00
|
|
|
# Messagebase formats
|
|
|
|
include $(TOP)/MSGBase.def
|
|
|
|
|
2000-10-06 22:04:07 +00:00
|
|
|
# Config files formats
|
|
|
|
include $(TOP)/Config.def
|
|
|
|
|
2000-02-25 10:15:17 +00:00
|
|
|
FOBJPATH=$(TOP)/$(OBJPATH)/$(PLATFORM)/$(TARGET)
|
2002-06-10 06:24:11 +00:00
|
|
|
FDEPPATH=$(TOP)/$(OBJPATH)/$(PLATFORM)/$(TARGET)
|
2000-02-25 10:15:17 +00:00
|
|
|
FLIBPATH=$(TOP)/$(LIBPATH)/$(PLATFORM)
|
|
|
|
|
|
|
|
.SUFFIXES: .c .cpp .all .rc
|
|
|
|
|
2001-05-27 19:28:13 +00:00
|
|
|
sourcelist: bld$(PLATFORM).inc
|
|
|
|
|
2000-02-25 10:15:17 +00:00
|
|
|
bld$(PLATFORM).inc: $(TARGET).all
|
|
|
|
@echo making sourcelist
|
2006-01-18 20:49:36 +00:00
|
|
|
@$(GREP) -w $(PLATFORM) $< \
|
|
|
|
| $(SED) 's;^\([[:alnum:]_]*\)[ ]*\([[:alnum:]_]*\).*;SOURCES+=\1.\2;' > $@; [ -s $@ ] || rm -f $@
|
2000-02-25 10:15:17 +00:00
|
|
|
|
|
|
|
$(FOBJPATH)/%$(OBJEXT): %.cpp
|
|
|
|
@echo building $(basename $<)$(OBJEXT)
|
2005-04-26 09:49:22 +00:00
|
|
|
$(CXX) -c -MD $(CPPFLAGS) -o $@ $<
|
2002-06-10 06:24:11 +00:00
|
|
|
@$(SHELL) -c "[ -s $(patsubst %.cpp,%.d,$<) ] && \
|
|
|
|
echo -n $(FOBJPATH)/>$(FDEPPATH)/$(patsubst %.cpp,%.d,$<) && \
|
|
|
|
$(CAT) $(patsubst %.cpp,%.d,$<)>>$(FDEPPATH)/$(patsubst %.cpp,%.d,$<) &&\
|
|
|
|
rm $(patsubst %.cpp,%.d,$<) || true"
|
2000-02-25 10:15:17 +00:00
|
|
|
|
2001-05-27 19:28:13 +00:00
|
|
|
$(FOBJPATH)/%$(OBJEXT): %.c
|
|
|
|
@echo building $(basename $<)$(OBJEXT)
|
2005-04-26 09:49:22 +00:00
|
|
|
$(CC) -c -MD $(CFLAGS) -o $@ $<
|
2002-06-10 06:24:11 +00:00
|
|
|
@$(SHELL) -c "[ -s $(patsubst %.c,%.d,$<) ] && \
|
|
|
|
echo -n $(FOBJPATH)/>$(FDEPPATH)/$(patsubst %.c,%.d,$<) && \
|
|
|
|
$(CAT) $(patsubst %.c,%.d,$<)>>$(FDEPPATH)/$(patsubst %.c,%.d,$<) && \
|
|
|
|
rm $(patsubst %.c,%.d,$<) || true"
|
2001-05-27 19:28:13 +00:00
|
|
|
|
|
|
|
ifeq ($(PLATFORM),cyg)
|
|
|
|
$(FOBJPATH)/%$(OBJEXT): %.rc
|
|
|
|
@echo creating resources
|
2001-07-23 03:55:38 +00:00
|
|
|
@$(WINDRES) --use-temp-file -o $@ $<
|
2001-05-27 19:28:13 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(PLATFORM),emx)
|
|
|
|
$(FOBJPATH)/%.res: %.rc
|
|
|
|
@echo creating resources
|
|
|
|
@rc $(subst -I,-i ,$(INCS)) -x1 -r $<
|
|
|
|
endif
|
|
|
|
|
|
|
|
SOURCES=
|
2002-06-10 06:24:11 +00:00
|
|
|
ifeq ($(wildcard $(TOP)/$(OBJPATH)/$(PLATFORM)/source.ls?),$(TOP)/$(OBJPATH)/$(PLATFORM)/source.lst)
|
2001-05-27 19:28:13 +00:00
|
|
|
include bld$(PLATFORM).inc
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(PLATFORM),cyg)
|
2001-05-28 04:27:12 +00:00
|
|
|
OBJS=$(addprefix $(FOBJPATH)/,$(patsubst %.rc,%$(OBJEXT),$(patsubst %.c,%$(OBJEXT),$(patsubst %.cpp,%$(OBJEXT),$(filter %.c %.cpp %.rc,$(SOURCES))))))
|
2001-05-27 19:28:13 +00:00
|
|
|
else
|
|
|
|
ifeq ($(PLATFORM),emx)
|
|
|
|
OBJS=$(addprefix $(FOBJPATH)/,$(patsubst %.rc,%.res,$(patsubst %.c,%$(OBJEXT),$(patsubst %.cpp,%$(OBJEXT),$(filter %.c %.cpp %.rc,$(SOURCES))))))
|
|
|
|
else
|
|
|
|
OBJS=$(addprefix $(FOBJPATH)/,$(patsubst %.c,%$(OBJEXT),$(patsubst %.cpp,%$(OBJEXT),$(filter %.c %.cpp %.rc,$(SOURCES)))))
|
|
|
|
endif
|
|
|
|
endif
|
2002-06-10 06:24:11 +00:00
|
|
|
DEPS = $(wildcard $(FDEPPATH)/*.d)
|
|
|
|
ALLOBJS = $(wildcard $(FOBJPATH)/*.o)
|
2001-05-27 19:28:13 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo cleaning...
|
2002-06-10 06:24:11 +00:00
|
|
|
@-rm -f $(ALLOBJS) $(DEPS) bld$(PLATFORM).inc
|
2001-05-27 19:28:13 +00:00
|
|
|
|
|
|
|
ifneq ($(DEPS),)
|
2002-06-10 06:24:11 +00:00
|
|
|
-include $(DEPS)
|
2001-05-27 19:28:13 +00:00
|
|
|
endif
|