2015-08-16 21:48:27 -05:00
|
|
|
# 22 april 2015
|
|
|
|
|
|
|
|
OUTBASE = new
|
|
|
|
OUTDIR = out
|
|
|
|
OBJDIR = .obj
|
|
|
|
|
|
|
|
IDLFILES = \
|
|
|
|
$(baseIDLFILES)
|
|
|
|
|
|
|
|
xHFILES = \
|
2015-08-27 11:05:11 -05:00
|
|
|
uipriv.h \
|
|
|
|
$(IDLFILES:%.idl=$(OUTDIR)/%.h) \
|
2015-08-16 21:48:27 -05:00
|
|
|
$(baseHFILES)
|
|
|
|
|
|
|
|
OFILES = \
|
|
|
|
$(baseCFILES:%.c=$(OBJDIR)/%.o) \
|
|
|
|
$(baseMFILES:%.m=$(OBJDIR)/%.o) \
|
|
|
|
$(baseRCFILES:%.rc=$(OBJDIR)/%.o)
|
|
|
|
|
|
|
|
xCFLAGS = \
|
|
|
|
-g \
|
|
|
|
-Wall -Wextra \
|
|
|
|
-Wno-unused-parameter \
|
|
|
|
-Wno-switch \
|
|
|
|
--std=c99 \
|
|
|
|
$(CFLAGS) \
|
|
|
|
$(archmflag) \
|
|
|
|
$(baseCFLAGS)
|
|
|
|
|
|
|
|
# windres doesn't support -m
|
|
|
|
xRCFLAGS = \
|
|
|
|
$(RCFLAGS) \
|
|
|
|
$(baseRCFLAGS)
|
|
|
|
|
|
|
|
xLDFLAGS = \
|
|
|
|
-g \
|
|
|
|
$(LDFLAGS) \
|
|
|
|
$(archmflag) \
|
|
|
|
$(baseLDFLAGS)
|
|
|
|
|
|
|
|
OUT = $(OUTDIR)/$(OUTBASE)$(baseSUFFIX)
|
|
|
|
|
|
|
|
$(OUT): $(OFILES) | $(OUTDIR)/.phony
|
|
|
|
@$(CC) -o $(OUT) $(OFILES) $(xLDFLAGS)
|
|
|
|
@echo ====== Linked $(OUT)
|
|
|
|
|
|
|
|
.SECONDEXPANSION:
|
|
|
|
$(OBJDIR)/%.o: %.c $(xHFILES) | $$(dir $$@).phony
|
|
|
|
@$(CC) -o $@ -c $< $(xCFLAGS)
|
|
|
|
@echo ====== Compiled $<
|
|
|
|
|
|
|
|
$(OBJDIR)/%.o: %.m $(xHFILES) | $$(dir $$@).phony
|
|
|
|
@$(CC) -o $@ -c $< $(xCFLAGS)
|
|
|
|
@echo ====== Compiled $<
|
|
|
|
|
|
|
|
$(OBJDIR)/%.o: %.rc $(xHFILES) | $$(dir $$@).phony
|
|
|
|
@$(RC) $(xRCFLAGS) $< $@
|
|
|
|
@echo ====== Compiled $<
|
|
|
|
|
|
|
|
# see http://www.cmcrossroads.com/article/making-directories-gnu-make
|
|
|
|
%/.phony:
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
@touch $@
|
|
|
|
.PRECIOUS: %/.phony
|
|
|
|
|
2015-08-27 11:05:11 -05:00
|
|
|
$(OUTDIR)/%.h: %.idl tools/idl2h.go | $(OUTDIR)/.phony
|
|
|
|
@go run tools/idl2h.go -extern _UI_EXTERN -guard __UI_UI_H__ < $< > $@
|
|
|
|
@echo ====== Generated `basename $@`
|
|
|
|
.PRECIOUS: $(OUTDIR)/%.h
|
|
|
|
|
2015-08-16 21:48:27 -05:00
|
|
|
clean:
|
|
|
|
rm -rf $(OUTDIR) $(OBJDIR) z*
|
|
|
|
.PHONY: clean
|