Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
enhance Makefile for packaging binary more easily
Browse files Browse the repository at this point in the history
  • Loading branch information
sean0921 committed Aug 22, 2019
1 parent 5ecf7e0 commit b41e3d8
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 24 deletions.
12 changes: 8 additions & 4 deletions 00_bern2time/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ FCFLAGS_MINGW := -DMINGW
OBJS = bern2time_FN bern2time getpl
OBJS_MINGW = bern2time_FN.exe bern2time.exe getpl.exe

PROJECT_PATH = 00_bern2time

all: $(OBJS)

%: %.for
Expand All @@ -19,16 +21,18 @@ mingw: $(OBJS_MINGW)
$(FC_MINGW) $(FCFLAGS) $(FCFLAGS_MINGW) -o $@ $^

install: $(OBJS)
install -m 0755 $(OBJS) test/
install -d ../build/$(PROJECT_PATH)/
install -m 0755 $(OBJS) ../build/$(PROJECT_PATH)/

mingw_install: $(OBJS_MINGW)
install -m 0755 $(OBJS_MINGW) test/
install -d ../build/$(PROJECT_PATH)/
install -m 0755 $(OBJS_MINGW) ../build/$(PROJECT_PATH)/

help:
@echo "all: compile program for Linux or other *nix-like platform"
@echo "mingw: compile program for Win32 platform"
@echo "install: install program for *nix-like platform to test/"
@echo "mingw_install: install program for Win32 platform to test/"
@echo "install: install program for *nix-like platform to build path"
@echo "mingw_install: install program for Win32 platform to build path"

clean:
rm -f $(OBJS) *.exe
12 changes: 8 additions & 4 deletions 01_raw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ FCFLAGS_MINGW := -DMINGW
OBJS = comfilt plot_ts
OBJS_MINGW = comfilt.exe plot_ts.exe

PROJECT_PATH = 01_raw

all: $(OBJS)

%: %.for
Expand All @@ -19,16 +21,18 @@ mingw: $(OBJS_MINGW)
$(FC_MINGW) $(FCFLAGS) $(FCFLAGS_MINGW) -o $@ $^

install: $(OBJS)
install -m 0755 $(OBJS) test/
install -d ../build/$(PROJECT_PATH)/
install -m 0755 $(OBJS) ../build/$(PROJECT_PATH)/

mingw_install: $(OBJS_MINGW)
install -m 0755 $(OBJS_MINGW) test/
install -d ../build/$(PROJECT_PATH)/
install -m 0755 $(OBJS_MINGW) ../build/$(PROJECT_PATH)/

help:
@echo "all: compile program for Linux or other *nix-like platform"
@echo "mingw: compile program for Win32 platform"
@echo "install: install program for *nix-like platform to test/"
@echo "mingw_install: install program for Win32 platform to test/"
@echo "install: install program for *nix-like platform to build path"
@echo "mingw_install: install program for Win32 platform to build path"

clean:
rm -f $(OBJS) *.exe
12 changes: 8 additions & 4 deletions 02_remove_trend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ FCFLAGS_MINGW := -DMINGW
OBJS = remove_trend plot_ts
OBJS_MINGW = remove_trend.exe plot_ts.exe

PROJECT_PATH = 02_remove_trend

all: $(OBJS)

%: %.for
Expand All @@ -19,16 +21,18 @@ mingw: $(OBJS_MINGW)
$(FC_MINGW) $(FCFLAGS) $(FCFLAGS_MINGW) -o $@ $^

install: $(OBJS)
install -m 0755 $(OBJS) test/
install -d ../build/$(PROJECT_PATH)/
install -m 0755 $(OBJS) ../build/$(PROJECT_PATH)/

mingw_install: $(OBJS_MINGW)
install -m 0755 $(OBJS_MINGW) test/
install -d ../build/$(PROJECT_PATH)/
install -m 0755 $(OBJS_MINGW) ../build/$(PROJECT_PATH)/

help:
@echo "all: compile program for Linux or other *nix-like platform"
@echo "mingw: compile program for Win32 platform"
@echo "install: install program for *nix-like platform to test/"
@echo "mingw_install: install program for Win32 platform to test/"
@echo "install: install program for *nix-like platform to build path"
@echo "mingw_install: install program for Win32 platform to build path"

clean:
rm -f $(OBJS) *.exe
12 changes: 8 additions & 4 deletions 03_remove_period/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ FCFLAGS_MINGW := -DMINGW
OBJS = remove_period plot_ts
OBJS_MINGW = remove_period.exe plot_ts.exe

PROJECT_PATH = 03_remove_period

all: $(OBJS)

%: %.for
Expand All @@ -19,16 +21,18 @@ mingw: $(OBJS_MINGW)
$(FC_MINGW) $(FCFLAGS) $(FCFLAGS_MINGW) -o $@ $^

install: $(OBJS)
install -m 0755 $(OBJS) test/
install -d ../build/$(PROJECT_PATH)/
install -m 0755 $(OBJS) ../build/$(PROJECT_PATH)/

mingw_install: $(OBJS_MINGW)
install -m 0755 $(OBJS_MINGW) test/
install -d ../build/$(PROJECT_PATH)/
install -m 0755 $(OBJS_MINGW) ../build/$(PROJECT_PATH)/

help:
@echo "all: compile program for Linux or other *nix-like platform"
@echo "mingw: compile program for Win32 platform"
@echo "install: install program for *nix-like platform to test/"
@echo "mingw_install: install program for Win32 platform to test/"
@echo "install: install program for *nix-like platform to build path"
@echo "mingw_install: install program for Win32 platform to build path"

clean:
rm -f $(OBJS) *.exe
12 changes: 8 additions & 4 deletions 04_remove_antenna/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ FCFLAGS_MINGW := -DMINGW
OBJS = remove_antenna plot_ts_2
OBJS_MINGW = remove_antenna.exe plot_ts_2.exe

PROJECT_PATH = 04_remove_antenna

all: $(OBJS)

%: %.for
Expand All @@ -19,16 +21,18 @@ mingw: $(OBJS_MINGW)
$(FC_MINGW) $(FCFLAGS) $(FCFLAGS_MINGW) -o $@ $^

install: $(OBJS)
install -m 0755 $(OBJS) test/
install -d ../build/$(PROJECT_PATH)/
install -m 0755 $(OBJS) ../build/$(PROJECT_PATH)/

mingw_install: $(OBJS_MINGW)
install -m 0755 $(OBJS_MINGW) test/
install -d ../build/$(PROJECT_PATH)/
install -m 0755 $(OBJS_MINGW) ../build/$(PROJECT_PATH)/

help:
@echo "all: compile program for Linux or other *nix-like platform"
@echo "mingw: compile program for Win32 platform"
@echo "install: install program for *nix-like platform to test/"
@echo "mingw_install: install program for Win32 platform to test/"
@echo "install: install program for *nix-like platform to build path"
@echo "mingw_install: install program for Win32 platform to build path"

clean:
rm -f $(OBJS) *.exe
15 changes: 15 additions & 0 deletions 05_post_dis/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
all:
@printf "\033[1;31mNothing to Make!\033[0m\n"

mingw:
@printf "\033[1;31mNothing to Make!\033[0m\n"

install:
@printf "\033[1;31mNoting to Install!\033[0m\n"

mingw_install:
@printf "\033[1;31mNoting to Install!\033[0m\n"

clean:
@printf "\033[1;31mNothing to Clean!\033[0m\n"

12 changes: 8 additions & 4 deletions 06_Fit_velocity/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ FCFLAGS_MINGW := -DMINGW
OBJS = fit plot_ts_2
OBJS_MINGW = fit.exe plot_ts_2.exe

PROJECT_PATH = 06_Fit_velocity

all: $(OBJS)

%: %.for
Expand All @@ -19,16 +21,18 @@ mingw: $(OBJS_MINGW)
$(FC_MINGW) $(FCFLAGS) $(FCFLAGS_MINGW) -o $@ $^

install: $(OBJS)
install -m 0755 $(OBJS) test/
install -d ../build/$(PROJECT_PATH)/
install -m 0755 $(OBJS) ../build/$(PROJECT_PATH)/

mingw_install: $(OBJS_MINGW)
install -m 0755 $(OBJS_MINGW) test/
install -d ../build/$(PROJECT_PATH)/
install -m 0755 $(OBJS_MINGW) ../build/$(PROJECT_PATH)/

help:
@echo "all: compile program for Linux or other *nix-like platform"
@echo "mingw: compile program for Win32 platform"
@echo "install: install program for *nix-like platform to test/"
@echo "mingw_install: install program for Win32 platform to test/"
@echo "install: install program for *nix-like platform to build path"
@echo "mingw_install: install program for Win32 platform to build path"

clean:
rm -f $(OBJS) *.exe
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#### Simple Makefile for build a pack

all:
for i in $$(ls -d 0*/);do cd $$i;$(MAKE);cd -;done

mingw:
for i in $$(ls -d 0*/);do cd $$i;$(MAKE) mingw;cd -;done

install:
for i in $$(ls -d 0*/);do cd $$i;$(MAKE) install;cd -;done

mingw_install:
for i in $$(ls -d 0*/);do cd $$i;$(MAKE) mingw_install;cd -;done

clean:
for i in $$(ls -d 0*/);do cd $$i;$(MAKE) clean;cd -;done

0 comments on commit b41e3d8

Please sign in to comment.