-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmac.mk
More file actions
executable file
·38 lines (30 loc) · 1.02 KB
/
mac.mk
File metadata and controls
executable file
·38 lines (30 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
CC := gcc
CFLAGS := -Wall -Werror -Wno-tautological-pointer-compare -std=c99 -g -Os `./pkg-config-script-mac --cflags gtk+-2.0` -DGTK2 -DOS_MAC
LFLAGS := `./pkg-config-script-mac --libs gtk+-2.0` -lm -lz
OBJ := obj/mac/
BIN := bin/mac/
TARGET := $(BIN)ImageToMapX
APP := $(TARGET).app/Contents/
SRCDIRS := src src/* src/*/* src/*/*/*
SOURCES := $(foreach DIR, $(SRCDIRS), $(wildcard $(DIR)/*.c))
OBJECTS = $(patsubst %.c, $(OBJ)%.o, $(SOURCES))
.PHONY: all
all: $(TARGET)
mac/fix.sh $(TARGET)
mkdir -p $(APP){MacOS,Resources}
cp mac/ImageToMapX $(APP)MacOS/ImageToMapX
cp $(TARGET) $(APP)MacOS/ImageToMapX-bin
cp -r resources/* $(APP)MacOS/
cp mac/Info.plist mac/PkgInfo $(APP)
cp mac/ImageToMapX.icns $(APP)Resources/
chmod -R 755 $(APP)
$(OBJ)%.o: %.c
mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
$(TARGET): $(OBJECTS)
@mkdir -p $(BIN)
$(CC) $(OBJECTS) $(LFLAGS) -o $(TARGET)
clean:
@$(call BEGRM, "RM", "$(BIN) $(OBJ)")
@$(RM) -rf $(BIN) $(OBJ)
@$(call ENDRM, "RM", "$(BIN) $(OBJ)")