2015-04-22 16:40:58 -05:00
|
|
|
# 22 april 2015
|
|
|
|
|
|
|
|
OUTBASE = new
|
|
|
|
OUTDIR = out
|
|
|
|
OBJDIR = .obj
|
|
|
|
|
|
|
|
xHFILES = \
|
|
|
|
ui.h \
|
|
|
|
$(baseHFILES)
|
|
|
|
|
|
|
|
OFILES = \
|
|
|
|
$(baseCFILES:%.c=$(OBJDIR)/%.o) \
|
|
|
|
$(baseMFILES:%.m=$(OBJDIR)/%.o)
|
|
|
|
|
|
|
|
xCFLAGS = \
|
|
|
|
-g \
|
|
|
|
-Wall -Wextra \
|
|
|
|
-Wno-unused-parameter \
|
|
|
|
-Wno-switch \
|
|
|
|
--std=c99 \
|
|
|
|
$(CFLAGS) \
|
2015-05-07 15:02:34 -05:00
|
|
|
$(archmflag) \
|
2015-04-22 16:40:58 -05:00
|
|
|
$(baseCFLAGS)
|
|
|
|
|
|
|
|
xLDFLAGS = \
|
|
|
|
-g \
|
|
|
|
$(LDFLAGS) \
|
2015-05-07 15:02:34 -05:00
|
|
|
$(archmflag) \
|
2015-04-22 16:40:58 -05:00
|
|
|
$(baseLDFLAGS)
|
|
|
|
|
|
|
|
OUT = $(OUTDIR)/$(OUTBASE)$(baseSUFFIX)
|
|
|
|
|
|
|
|
$(OUT): $(OFILES) | $(OUTDIR)/.phony
|
2015-05-07 17:46:19 -05:00
|
|
|
@$(CC) -o $(OUT) $(OFILES) $(xLDFLAGS)
|
|
|
|
@echo ====== Linked $(OUT)
|
2015-04-22 16:40:58 -05:00
|
|
|
|
|
|
|
.SECONDEXPANSION:
|
|
|
|
$(OBJDIR)/%.o: %.c $(xHFILES) | $$(dir $$@).phony
|
2015-05-07 17:46:19 -05:00
|
|
|
@$(CC) -o $@ -c $< $(xCFLAGS)
|
|
|
|
@echo ====== Compiled $<
|
2015-04-22 16:40:58 -05:00
|
|
|
|
2015-04-28 13:46:09 -05:00
|
|
|
$(OBJDIR)/%.o: %.m $(xHFILES) | $$(dir $$@).phony
|
2015-05-07 17:46:19 -05:00
|
|
|
@$(CC) -o $@ -c $< $(xCFLAGS)
|
|
|
|
@echo ====== Compiled $<
|
2015-04-28 13:46:09 -05:00
|
|
|
|
2015-04-22 16:40:58 -05:00
|
|
|
# see http://www.cmcrossroads.com/article/making-directories-gnu-make
|
|
|
|
%/.phony:
|
2015-05-07 17:46:19 -05:00
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
@touch $@
|
2015-04-22 16:40:58 -05:00
|
|
|
.PRECIOUS: %/.phony
|
|
|
|
|
|
|
|
ui.h: ui.idl
|
2015-05-11 09:24:47 -05:00
|
|
|
@idl2h -extern _UI_EXTERN -guard __UI_UI_H__ < ui.idl > ui.h
|
2015-05-07 17:46:19 -05:00
|
|
|
@echo ====== Generated ui.h
|
2015-04-22 16:40:58 -05:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(OUTDIR) $(OBJDIR) ui.h
|
|
|
|
.PHONY: clean
|