Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
blog
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rhatto
blog
Commits
d64d1088
Commit
d64d1088
authored
4 years ago
by
rhatto
Browse files
Options
Downloads
Patches
Plain Diff
Makefile: adds serve target (2)
parent
67d2d45d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Makefile
+50
-0
50 additions, 0 deletions
Makefile
with
50 additions
and
0 deletions
Makefile
0 → 100644
+
50
−
0
View file @
d64d1088
#
# Global Makefile - https://templater.fluxo.info
#
# This Makefile contains basic, common targets and also includes
# any Makefile.* available in the current folder.
#
# Port to serve content
HTTP_PORT
=
"8000"
HTTP_SERVER
=
"http.server"
# Base to serve the content
HTTP_BASE
=
"."
# Set CONTAINER based in what we have available in the system
# This variable can be user in other, included Makefiles to handle virtualization tasks
ifeq
($(shell which kvmx > /dev/null && test -s kvmxfile && echo yes), yes)
CONTAINER
=
kvmx
else
ifeq
($(shell which vagrant > /dev/null && test -s Vagrantfile && echo yes), yes)
CONTAINER
=
vagrant
else
ifeq
($(shell which docker > /dev/null && test -s Dockerfile && echo yes), yes)
CONTAINER
=
docker
else
CONTAINER
=
''
endif
# See http://unix.stackexchange.com/questions/32182/simple-command-line-http-server#32200
# http://php.net/manual/en/features.commandline.webserver.php
serve
:
@
if
[
"
$(
HTTP_SERVER
)
"
=
"SimpleHTTPServer"
]
;
then
cd
$(
HTTP_BASE
)
&&
python
-m
SimpleHTTPServer
$(
HTTP_PORT
);
fi
@
if
[
"
$(
HTTP_SERVER
)
"
=
"ssi_server"
]
;
then
cd
$(
HTTP_BASE
)
&&
PYTHONDONTWRITEBYTECODE
=
0 ssi_server.py
$(
HTTP_PORT
);
fi
@
if
[
"
$(
HTTP_SERVER
)
"
=
"http.server"
]
;
then
cd
$(
HTTP_BASE
)
&&
python3
-m
http.server
$(
HTTP_PORT
);
fi
@
if
[
"
$(
HTTP_SERVER
)
"
=
"php"
]
;
then
cd
$(
HTTP_BASE
)
&&
php
-S
localhost:
$(
HTTP_PORT
);
fi
# Configure a git post-receive hook
post_receive
:
git config receive.denyCurrentBranch ignore
test
-s
bin/post-receive
&&
cd
.git/hooks
&&
ln
-sf
../../bin/post-receive
# Process any other Makefile whose filename matches Makefile.*
# See https://www.gnu.org/software/make/manual/html_node/Include.html
#
# Some of those files might even contain local customizations/overrides
# that can be .gitignore'd, like a Makefile.local for example.
-include
Makefile.*
# Customization examples can be as simple as setting variables:
#CONTAINER = vagrant
#CONTAINER = docker
#DESTDIR ?= vendor
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment