diff options
| author | Pietro Gagliardi <[email protected]> | 2015-04-15 19:14:28 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-04-15 19:14:28 -0400 |
| commit | 35af32a3a6f257217a82e0249741e5f196c0123d (patch) | |
| tree | e38b56e1a71c0dff859ff31b73be09bd7de7524a /new/GNUmakefile | |
| parent | 98271437cb5a29f5b50903fc2eaeed52cd23e157 (diff) | |
Started building the make structure.
Diffstat (limited to 'new/GNUmakefile')
| -rw-r--r-- | new/GNUmakefile | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/new/GNUmakefile b/new/GNUmakefile new file mode 100644 index 0000000..2735929 --- /dev/null +++ b/new/GNUmakefile @@ -0,0 +1,57 @@ +# 15 april 2015 + +OBJDIR = .obj + +# windows does this so :/ +ifeq ($(OS),Windows_NT) +OS = windows +endif + +ifndef OS +UNAME = $(shell uname -s) +ifeq ($(UNAME),Darwin) +OS = darwin +else +OS = unix +endif +endif + +CFILES = \ + stack.c \ + test.c +HFILES = \ + ui.h \ + uipriv.h \ + ui_$(OS).h \ + $(OS)/uipriv_$(OS).h + +xCFLAGS = \ + -g \ + -Wall -Wextra \ + -Wno-unused-parameter \ + --std=c99 \ + $(CFLAGS) +xLDFLAGS = \ + -g \ + $(LDFLAGS) + +include $(OS)/GNUmakeinc.mk +xOSCFILES = $(OSCFILES:%=$(OS)/%) + +OFILES = $(CFILES:%.c=$(OBJDIR)/%.o) \ + $(xOSCFILES:$(OS)/%.c=$(OBJDIR)/%_$(OS).o) + +$(OUT): $(OFILES) + $(CC) -o $(OUT) $(OFILES) $(xLDFLAGS) + +$(OBJDIR)/%.o: %.c $(OBJDIR) $(HFILES) + $(CC) -o $@ -c $< $(xCFLAGS) + +$(OBJDIR)/%_$(OS).o: $(OS)/%.c $(OBJDIR) $(HFILES) + $(CC) -o $@ -c $< $(xCFLAGS) + +$(OBJDIR): + mkdir -p $(OBJDIR) + +ui.h: ui.idl + idl2h < ui.h > ui.idl |
